diff --git a/swaggerci/databoxedge/.gitattributes b/swaggerci/databoxedge/.gitattributes new file mode 100644 index 000000000000..2125666142eb --- /dev/null +++ b/swaggerci/databoxedge/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/swaggerci/databoxedge/.gitignore b/swaggerci/databoxedge/.gitignore new file mode 100644 index 000000000000..7998f37e1e47 --- /dev/null +++ b/swaggerci/databoxedge/.gitignore @@ -0,0 +1,5 @@ +bin +obj +.vs +tools +test/*-TestResults.xml \ No newline at end of file diff --git a/swaggerci/databoxedge/Az.DataBoxEdge.csproj b/swaggerci/databoxedge/Az.DataBoxEdge.csproj new file mode 100644 index 000000000000..8b174c84b191 --- /dev/null +++ b/swaggerci/databoxedge/Az.DataBoxEdge.csproj @@ -0,0 +1,43 @@ + + + + 0.1.0 + 7.1 + netstandard2.0 + Library + Az.DataBoxEdge.private + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge + true + false + ./bin + $(OutputPath) + Az.DataBoxEdge.nuspec + true + + 1998 + 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/databoxedge/Az.DataBoxEdge.format.ps1xml b/swaggerci/databoxedge/Az.DataBoxEdge.format.ps1xml new file mode 100644 index 000000000000..b2e053b24127 --- /dev/null +++ b/swaggerci/databoxedge/Az.DataBoxEdge.format.ps1xml @@ -0,0 +1,5883 @@ + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.DataBoxEdgeIdentity + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.DataBoxEdgeIdentity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AddonName + + + ContainerName + + + DeviceName + + + Id + + + Name + + + ResourceGroupName + + + RoleName + + + StorageAccountName + + + SubscriptionId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Addon + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Addon + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + Kind + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AddonList + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AddonList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Address + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Address + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + City + + + Country + + + Line1 + + + Line2 + + + Line3 + + + PostalCode + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Alert + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Alert + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertErrorDetails + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertErrorDetails + + + + + + + + + + + + + + + + + + ErrorCode + + + ErrorMessage + + + Occurrence + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertList + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertProperties + + + + + + + + + + + + + + + + + + + + + + + + AlertType + + + AppearedAtDateTime + + + Recommendation + + + Severity + + + Title + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertPropertiesDetailedInformation + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertPropertiesDetailedInformation + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArcAddon + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArcAddon + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Kind + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArcAddonProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArcAddonProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + HostPlatform + + + HostPlatformType + + + ProvisioningState + + + ResourceGroupName + + + ResourceLocation + + + ResourceName + + + SubscriptionId + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret + + + + + + + + + + + + + + + + + + EncryptionAlgorithm + + + EncryptionCertThumbprint + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AzureContainerInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AzureContainerInfo + + + + + + + + + + + + + + + + + + ContainerName + + + DataFormat + + + StorageAccountCredentialId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.BandwidthSchedule + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.BandwidthSchedule + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.BandwidthScheduleProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.BandwidthScheduleProperties + + + + + + + + + + + + + + + + + + + + + Day + + + RateInMbps + + + Start + + + Stop + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.BandwidthSchedulesList + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.BandwidthSchedulesList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClientAccessRight + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClientAccessRight + + + + + + + + + + + + + + + AccessPermission + + + Client + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudEdgeManagementRole + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudEdgeManagementRole + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Kind + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudEdgeManagementRoleProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudEdgeManagementRoleProperties + + + + + + + + + + + + + + + LocalManagementStatus + + + RoleStatus + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudErrorBody + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudErrorBody + + + + + + + + + + + + + + + Code + + + Message + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterCapacityViewData + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterCapacityViewData + + + + + + + + + + + + + + + + + + Fqdn + + + LastRefreshedTime + + + TotalProvisionedNonHpnCore + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterGpuCapacity + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterGpuCapacity + + + + + + + + + + + + + + + + + + + + + + + + GpuFreeUnitsCount + + + GpuReservedForFailoverUnitsCount + + + GpuTotalUnitsCount + + + GpuType + + + GpuUsedUnitsCount + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterMemoryCapacity + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterMemoryCapacity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ClusterFailoverMemoryMb + + + ClusterFragmentationMemoryMb + + + ClusterFreeMemoryMb + + + ClusterHypervReserveMemoryMb + + + ClusterInfraVMMemoryMb + + + ClusterMemoryUsedByVmsMb + + + ClusterNonFailoverVMMb + + + ClusterTotalMemoryMb + + + ClusterUsedMemoryMb + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterStorageViewData + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterStorageViewData + + + + + + + + + + + + + + + ClusterFreeStorageMb + + + ClusterTotalStorageMb + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CniConfig + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CniConfig + + + + + + + + + + + + + + + + + + + + + PodSubnet + + + ServiceSubnet + + + Type + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ComputeResource + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ComputeResource + + + + + + + + + + + + + + + MemoryInGb + + + ProcessorCount + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContactDetails + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContactDetails + + + + + + + + + + + + + + + + + + + + + CompanyName + + + ContactPerson + + + EmailList + + + Phone + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Container + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Container + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContainerList + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContainerList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContainerProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContainerProperties + + + + + + + + + + + + + + + + + + ContainerStatus + + + CreatedDateTime + + + DataFormat + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevice + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevice + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + Etag + + + Kind + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfo + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfoPatch + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfoPatch + + + + + + + + + + + + + + + + + + + + + + + + ChannelIntegrityKeyName + + + ChannelIntegrityKeyVersion + + + ClientSecretStoreId + + + ClientSecretStoreUrl + + + SyncStatus + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfoProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfoProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ChannelIntegrityKeyName + + + ChannelIntegrityKeyVersion + + + ClientSecretStoreId + + + ClientSecretStoreUrl + + + CloudWitnessContainerName + + + CloudWitnessStorageAccountName + + + CloudWitnessStorageEndpoint + + + ClusterWitnessType + + + EncryptionKey + + + EncryptionKeyThumbprint + + + FileShareWitnessLocation + + + FileShareWitnessUsername + + + KeyVaultSyncStatus + + + ResourceKey + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceList + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevicePatchTags + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevicePatchTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ConfiguredRoleType + + + Culture + + + DataBoxEdgeDeviceStatus + + + Description + + + DeviceHcsVersion + + + DeviceLocalCapacity + + + DeviceModel + + + DeviceSoftwareVersion + + + DeviceType + + + FriendlyName + + + ModelDescription + + + NodeCount + + + SerialNumber + + + TimeZone + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceTags + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeMoveRequest + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeMoveRequest + + + + + + + + + + + + + + + Resource + + + TargetResourceGroup + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeSku + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeSku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ApiVersion + + + Availability + + + Family + + + Kind + + + Location + + + Name + + + ResourceType + + + ShipmentType + + + SignupOption + + + Size + + + Tier + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeSkuList + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeSkuList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataResidency + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataResidency + + + + + + + + + + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DcAccessCodeProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DcAccessCodeProperties + + + + + + + + + + + + AuthCode + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityInfo + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityInfoProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityInfoProperties + + + + + + + + + + + + TimeStamp + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityRequestInfoProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityRequestInfoProperties + + + + + + + + + + + + VMPlacementQuery + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DiagnosticProactiveLogCollectionSettings + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DiagnosticProactiveLogCollectionSettings + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DiagnosticRemoteSupportSettings + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DiagnosticRemoteSupportSettings + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscription + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscription + + + + + + + + + + + + + + + + + + + + + + + + Id + + + RegistrationDate + + + RegistrationId + + + State + + + SubscriptionId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionPatch + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionPatch + + + + + + + + + + + + Id + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EtcdInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EtcdInfo + + + + + + + + + + + + + + + Type + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.FileEventTrigger + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.FileEventTrigger + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Kind + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.FileSourceInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.FileSourceInfo + + + + + + + + + + + + ShareId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.FileTriggerProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.FileTriggerProperties + + + + + + + + + + + + CustomContextTag + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.GenerateCertResponse + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.GenerateCertResponse + + + + + + + + + + + + + + + + + + ExpiryTimeInUtc + + + PrivateKey + + + PublicKey + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.HostCapacity + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.HostCapacity + + + + + + + + + + + + + + + + + + + + + AvailableGpuCount + + + EffectiveAvailableMemoryMbOnHost + + + GpuType + + + HostName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ImageRepositoryCredential + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ImageRepositoryCredential + + + + + + + + + + + + + + + ImageRepositoryUrl + + + UserName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTAddon + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTAddon + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Kind + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTAddonProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTAddonProperties + + + + + + + + + + + + + + + + + + + + + HostPlatform + + + HostPlatformType + + + ProvisioningState + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfo + + + + + + + + + + + + + + + + + + DeviceId + + + IoTHostHub + + + IoTHostHubId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTEdgeAgentInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTEdgeAgentInfo + + + + + + + + + + + + + + + ImageName + + + Tag + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTRole + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTRole + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Kind + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTRoleProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTRoleProperties + + + + + + + + + + + + + + + + + + HostPlatform + + + HostPlatformType + + + RoleStatus + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Ipv4Config + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Ipv4Config + + + + + + + + + + + + + + + + + + Gateway + + + IPAddress + + + Subnet + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Ipv6Config + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Ipv6Config + + + + + + + + + + + + + + + + + + Gateway + + + IPAddress + + + PrefixLength + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Job + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Job + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EndTime + + + Id + + + Name + + + PercentComplete + + + StartTime + + + Status + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobErrorDetails + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobErrorDetails + + + + + + + + + + + + + + + Code + + + Message + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobErrorItem + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobErrorItem + + + + + + + + + + + + + + + + + + Code + + + Message + + + Recommendation + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + CurrentStage + + + ErrorManifestFile + + + Folder + + + JobType + + + RefreshedEntityId + + + TotalRefreshError + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesClusterInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesClusterInfo + + + + + + + + + + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesIPConfiguration + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesIPConfiguration + + + + + + + + + + + + + + + IPAddress + + + Port + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRole + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRole + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Kind + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleCompute + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleCompute + + + + + + + + + + + + + + + + + + MemoryInByte + + + ProcessorCount + + + VMProfile + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleProperties + + + + + + + + + + + + + + + + + + + + + HostPlatform + + + HostPlatformType + + + ProvisioningState + + + RoleStatus + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorageClassInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorageClassInfo + + + + + + + + + + + + + + + + + + Name + + + PosixCompliant + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.LoadBalancerConfig + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.LoadBalancerConfig + + + + + + + + + + + + + + + Type + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MecRole + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MecRole + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Kind + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MecRoleProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MecRoleProperties + + + + + + + + + + + + + + + + + + ControllerEndpoint + + + ResourceUniqueId + + + RoleStatus + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricConfiguration + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricConfiguration + + + + + + + + + + + + + + + + + + MdmAccount + + + MetricNameSpace + + + ResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricCounter + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricCounter + + + + + + + + + + + + + + + Instance + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricDimension + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricDimension + + + + + + + + + + + + + + + SourceName + + + SourceType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricDimensionV1 + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricDimensionV1 + + + + + + + + + + + + + + + + + + DisplayName + + + Name + + + ToBeExportedForShoebox + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricSpecificationV1 + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricSpecificationV1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AggregationType + + + Category + + + DisplayDescription + + + DisplayName + + + FillGapWithZero + + + Name + + + ResourceIdDimensionNameOverride + + + SupportedAggregationType + + + SupportedTimeGrainType + + + Unit + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MonitoringMetricConfiguration + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MonitoringMetricConfiguration + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MonitoringMetricConfigurationList + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MonitoringMetricConfigurationList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMap + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMap + + + + + + + + + + + + + + + + + + + + + + + + MountPoint + + + MountType + + + RoleId + + + RoleType + + + ShareId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkAdapter + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkAdapter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AdapterId + + + DhcpStatus + + + DnsServer + + + Index + + + Ipv6LinkLocalAddress + + + Label + + + LinkSpeed + + + MacAddress + + + Name + + + NodeId + + + RdmaStatus + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkAdapterPosition + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkAdapterPosition + + + + + + + + + + + + + + + NetworkGroup + + + Port + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkSettings + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkSettings + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Node + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Node + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodeInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodeInfo + + + + + + + + + + + + + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodeList + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodeList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodeProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodeProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NodeChassisSerialNumber + + + NodeDisplayName + + + NodeFriendlySoftwareVersion + + + NodeHcsVersion + + + NodeInstanceId + + + NodeSerialNumber + + + NodeStatus + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NumaNodeData + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NumaNodeData + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EffectiveAvailableMemoryInMb + + + FreeVCpuIndexesForHpn + + + LogicalCoreCountPerCore + + + NumaNodeIndex + + + TotalMemoryInMb + + + VCpuIndexesForHpn + + + VCpuIndexesForRoot + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Operation + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Operation + + + + + + + + + + + + + + + + + + IsDataAction + + + Name + + + Origin + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OperationDisplay + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OperationDisplay + + + + + + + + + + + + + + + + + + + + + Description + + + Operation + + + Provider + + + Resource + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OperationsList + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OperationsList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Order + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Order + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + Kind + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderList + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderProperties + + + + + + + + + + + + + + + + + + OrderId + + + SerialNumber + + + ShipmentType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatus + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatus + + + + + + + + + + + + + + + + + + Comment + + + Status + + + UpdateDateTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatusAdditionalOrderDetails + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatusAdditionalOrderDetails + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.PeriodicTimerEventTrigger + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.PeriodicTimerEventTrigger + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Kind + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.PeriodicTimerProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.PeriodicTimerProperties + + + + + + + + + + + + CustomContextTag + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.PeriodicTimerSourceInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.PeriodicTimerSourceInfo + + + + + + + + + + + + + + + + + + Schedule + + + StartTime + + + Topic + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ProactiveLogCollectionSettingsProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ProactiveLogCollectionSettingsProperties + + + + + + + + + + + + UserConsent + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RawCertificateData + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RawCertificateData + + + + + + + + + + + + + + + AuthenticationType + + + Certificate + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RefreshDetails + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RefreshDetails + + + + + + + + + + + + + + + + + + + + + ErrorManifestFile + + + InProgressRefreshJobId + + + LastCompletedRefreshJobTimeInUtc + + + LastJob + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RemoteSupportSettings + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RemoteSupportSettings + + + + + + + + + + + + + + + + + + AccessLevel + + + ExpirationTimeStampInUtc + + + RemoteApplicationType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceIdentity + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceIdentity + + + + + + + + + + + + + + + + + + PrincipalId + + + TenantId + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceMoveDetails + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceMoveDetails + + + + + + + + + + + + + + + OperationInProgress + + + OperationInProgressLockTimeoutInUtc + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Role + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Role + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + Kind + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleList + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleSinkInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleSinkInfo + + + + + + + + + + + + RoleId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Secret + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Secret + + + + + + + + + + + + KeyVaultId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SecuritySettings + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SecuritySettings + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Share + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Share + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ShareAccessRight + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ShareAccessRight + + + + + + + + + + + + + + + AccessType + + + ShareId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ShareList + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ShareList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ShareProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ShareProperties + + + + + + + + + + + + + + + + + + + + + + + + AccessProtocol + + + DataPolicy + + + Description + + + MonitoringStatus + + + ShareStatus + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Sku + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Sku + + + + + + + + + + + + + + + Name + + + Tier + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SkuCapability + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SkuCapability + + + + + + + + + + + + + + + Name + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SkuCost + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SkuCost + + + + + + + + + + + + + + + + + + ExtendedUnit + + + MeterId + + + Quantity + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SkuLocationInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SkuLocationInfo + + + + + + + + + + + + + + + + + + Location + + + Site + + + Zone + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccount + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccount + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountCredential + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountCredential + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountCredentialList + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountCredentialList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountCredentialProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountCredentialProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccountType + + + Alias + + + BlobDomainName + + + ConnectionString + + + SslStatus + + + StorageAccountId + + + UserName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountList + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + BlobEndpoint + + + ContainerCount + + + DataPolicy + + + Description + + + StorageAccountCredentialId + + + StorageAccountStatus + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionProperties + + + + + + + + + + + + + + + + + + + + + LocationPlacementId + + + QuotaId + + + SerializedDetail + + + TenantId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionRegisteredFeatures + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionRegisteredFeatures + + + + + + + + + + + + + + + Name + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SupportPackageRequestProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SupportPackageRequestProperties + + + + + + + + + + + + + + + + + + Include + + + MaximumTimeStamp + + + MinimumTimeStamp + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfo + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfo + + + + + + + + + + + + + + + + + + + + + CarrierName + + + SerialNumber + + + TrackingId + + + TrackingUrl + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Trigger + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Trigger + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + Kind + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TriggerList + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TriggerList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TriggerSupportPackageRequest + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TriggerSupportPackageRequest + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateDetails + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateDetails + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EstimatedInstallTimeInMin + + + FriendlyVersionNumber + + + InstallationImpact + + + RebootBehavior + + + Status + + + TargetVersion + + + UpdateSize + + + UpdateTitle + + + UpdateType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateDownloadProgress + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateDownloadProgress + + + + + + + + + + + + + + + + + + + + + + + + + + + DownloadPhase + + + NumberOfUpdatesDownloaded + + + NumberOfUpdatesToDownload + + + PercentComplete + + + TotalBytesDownloaded + + + TotalBytesToDownload + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateInstallProgress + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateInstallProgress + + + + + + + + + + + + + + + + + + NumberOfUpdatesInstalled + + + NumberOfUpdatesToInstall + + + PercentComplete + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateSummary + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateSummary + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateSummaryProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateSummaryProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DeviceLastScannedDateTime + + + DeviceVersionNumber + + + FriendlyDeviceVersionName + + + InProgressDownloadJobId + + + InProgressDownloadJobStartedDateTime + + + InProgressInstallJobId + + + InProgressInstallJobStartedDateTime + + + LastCompletedDownloadJobDateTime + + + LastCompletedDownloadJobId + + + LastCompletedInstallJobDateTime + + + LastCompletedInstallJobId + + + LastCompletedScanJobDateTime + + + LastDownloadJobStatus + + + LastInstallJobStatus + + + LastSuccessfulInstallJobDateTime + + + LastSuccessfulScanJobTime + + + OngoingUpdateOperation + + + RebootBehavior + + + TotalNumberOfUpdatesAvailable + + + TotalNumberOfUpdatesPendingDownload + + + TotalNumberOfUpdatesPendingInstall + + + TotalTimeInMinute + + + TotalUpdateSizeInByte + + + UpdateTitle + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UploadCertificateResponse + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UploadCertificateResponse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AadAudience + + + AadAuthority + + + AadTenantId + + + AuthType + + + AzureManagementEndpointAudience + + + ResourceId + + + ServicePrincipalClientId + + + ServicePrincipalObjectId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.User + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.User + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UserAccessRight + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UserAccessRight + + + + + + + + + + + + + + + AccessType + + + UserId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UserList + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UserList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UserProperties + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UserProperties + + + + + + + + + + + + UserType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.VMMemory + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.VMMemory + + + + + + + + + + + + + + + CurrentMemoryUsageMb + + + StartupMemoryMb + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.VMPlacementRequestResult + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.VMPlacementRequestResult + + + + + + + + + + + + + + + + + + + + + IsFeasible + + + Message + + + MessageCode + + + VMSize + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData + + + + + + + + + + + + + + + + + + + + + + + + + + + CreatedAt + + + CreatedBy + + + CreatedByType + + + LastModifiedAt + + + LastModifiedBy + + + LastModifiedByType + + + + + + + + \ No newline at end of file diff --git a/swaggerci/databoxedge/Az.DataBoxEdge.nuspec b/swaggerci/databoxedge/Az.DataBoxEdge.nuspec new file mode 100644 index 000000000000..f1702c8bc308 --- /dev/null +++ b/swaggerci/databoxedge/Az.DataBoxEdge.nuspec @@ -0,0 +1,32 @@ + + + + Az.DataBoxEdge + 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/databoxedge/Az.DataBoxEdge.psd1 b/swaggerci/databoxedge/Az.DataBoxEdge.psd1 new file mode 100644 index 000000000000..758ef5b6320d --- /dev/null +++ b/swaggerci/databoxedge/Az.DataBoxEdge.psd1 @@ -0,0 +1,24 @@ +@{ + GUID = '9b726635-8457-4844-b20a-42443e9f5811' + RootModule = './Az.DataBoxEdge.psm1' + ModuleVersion = '0.1.0' + CompatiblePSEditions = 'Core', 'Desktop' + Author = 'Microsoft Corporation' + CompanyName = 'Microsoft Corporation' + Copyright = 'Microsoft Corporation. All rights reserved.' + Description = 'Microsoft Azure PowerShell: DataBoxEdge cmdlets' + PowerShellVersion = '5.1' + DotNetFrameworkVersion = '4.7.2' + RequiredAssemblies = './bin/Az.DataBoxEdge.private.dll' + FormatsToProcess = './Az.DataBoxEdge.format.ps1xml' + FunctionsToExport = 'Get-AzDataBoxEdgeAddon', 'Get-AzDataBoxEdgeAlert', 'Get-AzDataBoxEdgeAvailableSku', 'Get-AzDataBoxEdgeBandwidthSchedule', 'Get-AzDataBoxEdgeContainer', 'Get-AzDataBoxEdgeDevice', 'Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo', 'Get-AzDataBoxEdgeDeviceExtendedInformation', 'Get-AzDataBoxEdgeDeviceNetworkSetting', 'Get-AzDataBoxEdgeDeviceUpdateSummary', 'Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting', 'Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting', 'Get-AzDataBoxEdgeJob', 'Get-AzDataBoxEdgeMonitoringConfig', 'Get-AzDataBoxEdgeNode', 'Get-AzDataBoxEdgeOperationsStatus', 'Get-AzDataBoxEdgeOrder', 'Get-AzDataBoxEdgeOrderDcAccessCode', 'Get-AzDataBoxEdgeRole', 'Get-AzDataBoxEdgeShare', 'Get-AzDataBoxEdgeStorageAccount', 'Get-AzDataBoxEdgeStorageAccountCredentials', 'Get-AzDataBoxEdgeTrigger', 'Get-AzDataBoxEdgeUser', 'Install-AzDataBoxEdgeDeviceUpdate', 'Invoke-AzDataBoxEdgeDownloadDeviceUpdate', 'Invoke-AzDataBoxEdgeScanDevice', 'Invoke-AzDataBoxEdgeUploadDeviceCertificate', 'New-AzDataBoxEdgeAddon', 'New-AzDataBoxEdgeBandwidthSchedule', 'New-AzDataBoxEdgeContainer', 'New-AzDataBoxEdgeDevice', 'New-AzDataBoxEdgeDeviceCertificate', 'New-AzDataBoxEdgeDeviceSecuritySetting', 'New-AzDataBoxEdgeMonitoringConfig', 'New-AzDataBoxEdgeOrder', 'New-AzDataBoxEdgeRole', 'New-AzDataBoxEdgeShare', 'New-AzDataBoxEdgeStorageAccount', 'New-AzDataBoxEdgeStorageAccountCredentials', 'New-AzDataBoxEdgeTrigger', 'New-AzDataBoxEdgeUser', 'Remove-AzDataBoxEdgeAddon', 'Remove-AzDataBoxEdgeBandwidthSchedule', 'Remove-AzDataBoxEdgeContainer', 'Remove-AzDataBoxEdgeDevice', 'Remove-AzDataBoxEdgeMonitoringConfig', 'Remove-AzDataBoxEdgeOrder', 'Remove-AzDataBoxEdgeRole', 'Remove-AzDataBoxEdgeShare', 'Remove-AzDataBoxEdgeStorageAccount', 'Remove-AzDataBoxEdgeStorageAccountCredentials', 'Remove-AzDataBoxEdgeTrigger', 'Remove-AzDataBoxEdgeUser', 'Start-AzDataBoxEdgeSupportPackage', 'Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility', 'Update-AzDataBoxEdgeContainer', 'Update-AzDataBoxEdgeDevice', 'Update-AzDataBoxEdgeDeviceExtendedInformation', 'Update-AzDataBoxEdgeDeviceSecuritySetting', 'Update-AzDataBoxEdgeShare', '*' + AliasesToExport = '*' + PrivateData = @{ + PSData = @{ + Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'DataBoxEdge' + LicenseUri = 'https://aka.ms/azps-license' + ProjectUri = 'https://github.com/Azure/azure-powershell' + ReleaseNotes = '' + } + } +} diff --git a/swaggerci/databoxedge/Az.DataBoxEdge.psm1 b/swaggerci/databoxedge/Az.DataBoxEdge.psm1 new file mode 100644 index 000000000000..d911358dfca5 --- /dev/null +++ b/swaggerci/databoxedge/Az.DataBoxEdge.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.DataBoxEdge.private.dll') + + # Get the private module's instance + $instance = [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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/databoxedge/MSSharedLibKey.snk b/swaggerci/databoxedge/MSSharedLibKey.snk new file mode 100644 index 000000000000..695f1b38774e Binary files /dev/null and b/swaggerci/databoxedge/MSSharedLibKey.snk differ diff --git a/swaggerci/databoxedge/README.md b/swaggerci/databoxedge/README.md new file mode 100644 index 000000000000..25f900d52750 --- /dev/null +++ b/swaggerci/databoxedge/README.md @@ -0,0 +1,27 @@ + +# Az.DataBoxEdge +This directory contains the PowerShell module for the DataBoxEdge service. + +--- +## Status +[![Az.DataBoxEdge](https://img.shields.io/powershellgallery/v/Az.DataBoxEdge.svg?style=flat-square&label=Az.DataBoxEdge "Az.DataBoxEdge")](https://www.powershellgallery.com/packages/Az.DataBoxEdge/) + +## 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.DataBoxEdge`, see [how-to.md](how-to.md). + diff --git a/swaggerci/databoxedge/build-module.ps1 b/swaggerci/databoxedge/build-module.ps1 new file mode 100644 index 000000000000..ce050cf062ec --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.psd1' +$guid = Get-ModuleGuid -Psd1Path $psd1 +$moduleName = 'Az.DataBoxEdge' +$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: DataBoxEdge 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.DataBoxEdge.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/databoxedge/check-dependencies.ps1 b/swaggerci/databoxedge/check-dependencies.ps1 new file mode 100644 index 000000000000..7400c6e1be47 --- /dev/null +++ b/swaggerci/databoxedge/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)) { + $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/databoxedge/create-model-cmdlets.ps1 b/swaggerci/databoxedge/create-model-cmdlets.ps1 new file mode 100644 index 000000000000..c61451f9768d --- /dev/null +++ b/swaggerci/databoxedge/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 = 'DataBoxEdge' + $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/databoxedge/custom/Az.DataBoxEdge.custom.psm1 b/swaggerci/databoxedge/custom/Az.DataBoxEdge.custom.psm1 new file mode 100644 index 000000000000..daccdd1697e0 --- /dev/null +++ b/swaggerci/databoxedge/custom/Az.DataBoxEdge.custom.psm1 @@ -0,0 +1,17 @@ +# region Generated + # Load the private module dll + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.DataBoxEdge.private.dll') + + # Load the internal module + $internalModulePath = Join-Path $PSScriptRoot '../internal/Az.DataBoxEdge.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/databoxedge/custom/README.md b/swaggerci/databoxedge/custom/README.md new file mode 100644 index 000000000000..57cb649195f7 --- /dev/null +++ b/swaggerci/databoxedge/custom/README.md @@ -0,0 +1,41 @@ +# Custom +This directory contains custom implementation for non-generated cmdlets for the `Az.DataBoxEdge` 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.DataBoxEdge.custom.psm1`. This file should not be modified. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: yes + +## Details +For `Az.DataBoxEdge` 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge`. 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.DataBoxEdge.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.DataBoxEdge.DoNotExportAttribute` + - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.DataBoxEdge`. +- `Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.InternalExportAttribute` + - Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.DataBoxEdge`. For more information, see [README.md](../internal/README.md) in the `../internal` folder. +- `Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/docs/Az.DataBoxEdge.md b/swaggerci/databoxedge/docs/Az.DataBoxEdge.md new file mode 100644 index 000000000000..9f571d5ef257 --- /dev/null +++ b/swaggerci/databoxedge/docs/Az.DataBoxEdge.md @@ -0,0 +1,197 @@ +--- +Module Name: Az.DataBoxEdge +Module Guid: 9b726635-8457-4844-b20a-42443e9f5811 +Download Help Link: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge +Help Version: 1.0.0.0 +Locale: en-US +--- + +# Az.DataBoxEdge Module +## Description +Microsoft Azure PowerShell: DataBoxEdge cmdlets + +## Az.DataBoxEdge Cmdlets +### [Get-AzDataBoxEdgeAddon](Get-AzDataBoxEdgeAddon.md) +Gets a specific addon by name. + +### [Get-AzDataBoxEdgeAlert](Get-AzDataBoxEdgeAlert.md) +Gets an alert by name. + +### [Get-AzDataBoxEdgeAvailableSku](Get-AzDataBoxEdgeAvailableSku.md) +List all the available Skus and information related to them. + +### [Get-AzDataBoxEdgeBandwidthSchedule](Get-AzDataBoxEdgeBandwidthSchedule.md) +Gets the properties of the specified bandwidth schedule. + +### [Get-AzDataBoxEdgeContainer](Get-AzDataBoxEdgeContainer.md) +Gets a container by name. + +### [Get-AzDataBoxEdgeDevice](Get-AzDataBoxEdgeDevice.md) +Gets the properties of the Data Box Edge/Data Box Gateway device. + +### [Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo](Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo.md) +Gets the properties of the specified device capacity info. + +### [Get-AzDataBoxEdgeDeviceExtendedInformation](Get-AzDataBoxEdgeDeviceExtendedInformation.md) +Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. + +### [Get-AzDataBoxEdgeDeviceNetworkSetting](Get-AzDataBoxEdgeDeviceNetworkSetting.md) +Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + +### [Get-AzDataBoxEdgeDeviceUpdateSummary](Get-AzDataBoxEdgeDeviceUpdateSummary.md) +Gets information about the availability of updates based on the last scan of the device. +It also gets information about any ongoing download or install jobs on the device. + +### [Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting](Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting.md) +Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. + +### [Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting](Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting.md) +Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. + +### [Get-AzDataBoxEdgeJob](Get-AzDataBoxEdgeJob.md) +Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + +### [Get-AzDataBoxEdgeMonitoringConfig](Get-AzDataBoxEdgeMonitoringConfig.md) +Gets a metric configuration of a role. + +### [Get-AzDataBoxEdgeNode](Get-AzDataBoxEdgeNode.md) +Gets all the nodes currently configured under this Data Box Edge device + +### [Get-AzDataBoxEdgeOperationsStatus](Get-AzDataBoxEdgeOperationsStatus.md) +Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + +### [Get-AzDataBoxEdgeOrder](Get-AzDataBoxEdgeOrder.md) +Gets a specific order by name. + +### [Get-AzDataBoxEdgeOrderDcAccessCode](Get-AzDataBoxEdgeOrderDcAccessCode.md) +Gets the DCAccess Code + +### [Get-AzDataBoxEdgeRole](Get-AzDataBoxEdgeRole.md) +Gets a specific role by name. + +### [Get-AzDataBoxEdgeShare](Get-AzDataBoxEdgeShare.md) +Gets a share by name. + +### [Get-AzDataBoxEdgeStorageAccount](Get-AzDataBoxEdgeStorageAccount.md) +Gets a StorageAccount by name. + +### [Get-AzDataBoxEdgeStorageAccountCredentials](Get-AzDataBoxEdgeStorageAccountCredentials.md) +Gets the properties of the specified storage account credential. + +### [Get-AzDataBoxEdgeTrigger](Get-AzDataBoxEdgeTrigger.md) +Get a specific trigger by name. + +### [Get-AzDataBoxEdgeUser](Get-AzDataBoxEdgeUser.md) +Gets the properties of the specified user. + +### [Install-AzDataBoxEdgeDeviceUpdate](Install-AzDataBoxEdgeDeviceUpdate.md) +Installs the updates on the Data Box Edge/Data Box Gateway device. + +### [Invoke-AzDataBoxEdgeDownloadDeviceUpdate](Invoke-AzDataBoxEdgeDownloadDeviceUpdate.md) +Downloads the updates on a Data Box Edge/Data Box Gateway device. + +### [Invoke-AzDataBoxEdgeScanDevice](Invoke-AzDataBoxEdgeScanDevice.md) +Scans for updates on a Data Box Edge/Data Box Gateway device. + +### [Invoke-AzDataBoxEdgeUploadDeviceCertificate](Invoke-AzDataBoxEdgeUploadDeviceCertificate.md) +Uploads registration certificate for the device. + +### [New-AzDataBoxEdgeAddon](New-AzDataBoxEdgeAddon.md) +Create or update a addon. + +### [New-AzDataBoxEdgeBandwidthSchedule](New-AzDataBoxEdgeBandwidthSchedule.md) +Creates or updates a bandwidth schedule. + +### [New-AzDataBoxEdgeContainer](New-AzDataBoxEdgeContainer.md) +Creates a new container or updates an existing container on the device. + +### [New-AzDataBoxEdgeDevice](New-AzDataBoxEdgeDevice.md) +Creates or updates a Data Box Edge/Data Box Gateway resource. + +### [New-AzDataBoxEdgeDeviceCertificate](New-AzDataBoxEdgeDeviceCertificate.md) +Generates certificate for activation key. + +### [New-AzDataBoxEdgeDeviceSecuritySetting](New-AzDataBoxEdgeDeviceSecuritySetting.md) +Updates the security settings on a Data Box Edge/Data Box Gateway device. + +### [New-AzDataBoxEdgeMonitoringConfig](New-AzDataBoxEdgeMonitoringConfig.md) +Creates a new metric configuration or updates an existing one for a role. + +### [New-AzDataBoxEdgeOrder](New-AzDataBoxEdgeOrder.md) +Creates or updates an order. + +### [New-AzDataBoxEdgeRole](New-AzDataBoxEdgeRole.md) +Create or update a role. + +### [New-AzDataBoxEdgeShare](New-AzDataBoxEdgeShare.md) +Creates a new share or updates an existing share on the device. + +### [New-AzDataBoxEdgeStorageAccount](New-AzDataBoxEdgeStorageAccount.md) +Creates a new StorageAccount or updates an existing StorageAccount on the device. + +### [New-AzDataBoxEdgeStorageAccountCredentials](New-AzDataBoxEdgeStorageAccountCredentials.md) +Creates or updates the storage account credential. + +### [New-AzDataBoxEdgeTrigger](New-AzDataBoxEdgeTrigger.md) +Creates or updates a trigger. + +### [New-AzDataBoxEdgeUser](New-AzDataBoxEdgeUser.md) +Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + +### [Remove-AzDataBoxEdgeAddon](Remove-AzDataBoxEdgeAddon.md) +Deletes the addon on the device. + +### [Remove-AzDataBoxEdgeBandwidthSchedule](Remove-AzDataBoxEdgeBandwidthSchedule.md) +Deletes the specified bandwidth schedule. + +### [Remove-AzDataBoxEdgeContainer](Remove-AzDataBoxEdgeContainer.md) +Deletes the container on the Data Box Edge/Data Box Gateway device. + +### [Remove-AzDataBoxEdgeDevice](Remove-AzDataBoxEdgeDevice.md) +Deletes the Data Box Edge/Data Box Gateway device. + +### [Remove-AzDataBoxEdgeMonitoringConfig](Remove-AzDataBoxEdgeMonitoringConfig.md) +deletes a new metric configuration for a role. + +### [Remove-AzDataBoxEdgeOrder](Remove-AzDataBoxEdgeOrder.md) +Deletes the order related to the device. + +### [Remove-AzDataBoxEdgeRole](Remove-AzDataBoxEdgeRole.md) +Deletes the role on the device. + +### [Remove-AzDataBoxEdgeShare](Remove-AzDataBoxEdgeShare.md) +Deletes the share on the Data Box Edge/Data Box Gateway device. + +### [Remove-AzDataBoxEdgeStorageAccount](Remove-AzDataBoxEdgeStorageAccount.md) +Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + +### [Remove-AzDataBoxEdgeStorageAccountCredentials](Remove-AzDataBoxEdgeStorageAccountCredentials.md) +Deletes the storage account credential. + +### [Remove-AzDataBoxEdgeTrigger](Remove-AzDataBoxEdgeTrigger.md) +Deletes the trigger on the gateway device. + +### [Remove-AzDataBoxEdgeUser](Remove-AzDataBoxEdgeUser.md) +Deletes the user on a databox edge/gateway device. + +### [Start-AzDataBoxEdgeSupportPackage](Start-AzDataBoxEdgeSupportPackage.md) +Triggers support package on the device + +### [Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility](Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility.md) +Posts the device capacity request info to check feasibility. + +### [Update-AzDataBoxEdgeContainer](Update-AzDataBoxEdgeContainer.md) +Refreshes the container metadata with the data from the cloud. + +### [Update-AzDataBoxEdgeDevice](Update-AzDataBoxEdgeDevice.md) +Modifies a Data Box Edge/Data Box Gateway resource. + +### [Update-AzDataBoxEdgeDeviceExtendedInformation](Update-AzDataBoxEdgeDeviceExtendedInformation.md) +Gets additional information for the specified Data Box Edge/Data Box Gateway device. + +### [Update-AzDataBoxEdgeDeviceSecuritySetting](Update-AzDataBoxEdgeDeviceSecuritySetting.md) +Updates the security settings on a Data Box Edge/Data Box Gateway device. + +### [Update-AzDataBoxEdgeShare](Update-AzDataBoxEdgeShare.md) +Refreshes the share metadata with the data from the cloud. + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeAddon.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeAddon.md new file mode 100644 index 000000000000..b749d8c719be --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeAddon.md @@ -0,0 +1,199 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeaddon +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeAddon + +## SYNOPSIS +Gets a specific addon by name. + +## SYNTAX + +### List (Default) +``` +Get-AzDataBoxEdgeAddon -DeviceName -ResourceGroupName -RoleName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzDataBoxEdgeAddon -DeviceName -Name -ResourceGroupName -RoleName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeAddon -InputObject [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets a specific addon by 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The addon name. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: AddonName + +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 +``` + +### -RoleName +The role 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeAlert.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeAlert.md new file mode 100644 index 000000000000..e28db2d7a506 --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeAlert.md @@ -0,0 +1,184 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgealert +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeAlert + +## SYNOPSIS +Gets an alert by name. + +## SYNTAX + +### List (Default) +``` +Get-AzDataBoxEdgeAlert -DeviceName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzDataBoxEdgeAlert -DeviceName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeAlert -InputObject [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets an alert by 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The alert 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, 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeAvailableSku.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeAvailableSku.md new file mode 100644 index 000000000000..3cc300ff088b --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeAvailableSku.md @@ -0,0 +1,92 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeavailablesku +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeAvailableSku + +## SYNOPSIS +List all the available Skus and information related to them. + +## SYNTAX + +``` +Get-AzDataBoxEdgeAvailableSku [-SubscriptionId ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +List all the available Skus and information related to them. + +## 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 +``` + +### -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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeBandwidthSchedule.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeBandwidthSchedule.md new file mode 100644 index 000000000000..67517052cd8c --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeBandwidthSchedule.md @@ -0,0 +1,185 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgebandwidthschedule +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeBandwidthSchedule + +## SYNOPSIS +Gets the properties of the specified bandwidth schedule. + +## SYNTAX + +### List (Default) +``` +Get-AzDataBoxEdgeBandwidthSchedule -DeviceName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzDataBoxEdgeBandwidthSchedule -DeviceName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeBandwidthSchedule -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets the properties of the specified bandwidth schedule. + +## 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The bandwidth schedule 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, 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeContainer.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeContainer.md new file mode 100644 index 000000000000..c2c8a684cf6b --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeContainer.md @@ -0,0 +1,200 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgecontainer +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeContainer + +## SYNOPSIS +Gets a container by name. + +## SYNTAX + +### List (Default) +``` +Get-AzDataBoxEdgeContainer -DeviceName -ResourceGroupName -StorageAccountName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzDataBoxEdgeContainer -DeviceName -Name -ResourceGroupName + -StorageAccountName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeContainer -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets a container by 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The container Name + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: ContainerName + +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 +``` + +### -StorageAccountName +The Storage Account 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDevice.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDevice.md new file mode 100644 index 000000000000..020c4c31aacf --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDevice.md @@ -0,0 +1,190 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgedevice +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeDevice + +## SYNOPSIS +Gets the properties of the Data Box Edge/Data Box Gateway device. + +## SYNTAX + +### List (Default) +``` +Get-AzDataBoxEdgeDevice [-SubscriptionId ] [-Expand ] [-DefaultProfile ] + [] +``` + +### Get +``` +Get-AzDataBoxEdgeDevice -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeDevice -InputObject [-DefaultProfile ] [] +``` + +### List1 +``` +Get-AzDataBoxEdgeDevice -ResourceGroupName [-SubscriptionId ] [-Expand ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the properties of the Data Box Edge/Data Box Gateway 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 +``` + +### -Expand +Specify $expand=details to populate additional fields related to the resource or Specify $skipToken=\ to populate the next page in the list. + +```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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +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, 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo.md new file mode 100644 index 000000000000..8f1307d5521a --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo.md @@ -0,0 +1,164 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgedevicecapacityinfodevicecapacityinfo +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo + +## SYNOPSIS +Gets the properties of the specified device capacity info. + +## SYNTAX + +### Get (Default) +``` +Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo -DeviceName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the properties of the specified device capacity info. + +## 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfo + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDeviceExtendedInformation.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDeviceExtendedInformation.md new file mode 100644 index 000000000000..b1306261d371 --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDeviceExtendedInformation.md @@ -0,0 +1,195 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgedeviceextendedinformation +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeDeviceExtendedInformation + +## SYNOPSIS +Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. + +## SYNTAX + +### Get (Default) +``` +Get-AzDataBoxEdgeDeviceExtendedInformation -DeviceName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeDeviceExtendedInformation -InputObject [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Gets additional information for the specified Azure Stack Edge/Data Box Gateway 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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDeviceNetworkSetting.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDeviceNetworkSetting.md new file mode 100644 index 000000000000..acb04c2a1458 --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDeviceNetworkSetting.md @@ -0,0 +1,164 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgedevicenetworksetting +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeDeviceNetworkSetting + +## SYNOPSIS +Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + +## SYNTAX + +### Get (Default) +``` +Get-AzDataBoxEdgeDeviceNetworkSetting -DeviceName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeDeviceNetworkSetting -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets the network settings of the specified Data Box Edge/Data Box Gateway 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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDeviceUpdateSummary.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDeviceUpdateSummary.md new file mode 100644 index 000000000000..1c71f37fa605 --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDeviceUpdateSummary.md @@ -0,0 +1,166 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgedeviceupdatesummary +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeDeviceUpdateSummary + +## SYNOPSIS +Gets information about the availability of updates based on the last scan of the device. +It also gets information about any ongoing download or install jobs on the device. + +## SYNTAX + +### Get (Default) +``` +Get-AzDataBoxEdgeDeviceUpdateSummary -DeviceName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeDeviceUpdateSummary -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets information about the availability of updates based on the last scan of the device. +It also gets information about any ongoing download or install jobs 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 + +### -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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummary + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting.md new file mode 100644 index 000000000000..d9c63f88ffff --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting.md @@ -0,0 +1,164 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgediagnosticsettingdiagnosticproactivelogcollectionsetting +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting + +## SYNOPSIS +Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. + +## SYNTAX + +### Get (Default) +``` +Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting -DeviceName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway 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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting.md new file mode 100644 index 000000000000..5e58e4d1f438 --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting.md @@ -0,0 +1,164 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgediagnosticsettingdiagnosticremotesupportsetting +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting + +## SYNOPSIS +Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. + +## SYNTAX + +### Get (Default) +``` +Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting -DeviceName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway 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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeJob.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeJob.md new file mode 100644 index 000000000000..0c499c739e3a --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeJob.md @@ -0,0 +1,178 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgejob +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeJob + +## SYNOPSIS +Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + +## SYNTAX + +### Get (Default) +``` +Get-AzDataBoxEdgeJob -DeviceName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeJob -InputObject [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the details of a specified job on a Data Box Edge/Data Box Gateway 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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The job 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeMonitoringConfig.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeMonitoringConfig.md new file mode 100644 index 000000000000..f78098122c57 --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeMonitoringConfig.md @@ -0,0 +1,185 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgemonitoringconfig +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeMonitoringConfig + +## SYNOPSIS +Gets a metric configuration of a role. + +## SYNTAX + +### Get (Default) +``` +Get-AzDataBoxEdgeMonitoringConfig -DeviceName -ResourceGroupName -RoleName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeMonitoringConfig -InputObject [-DefaultProfile ] + [] +``` + +### List +``` +Get-AzDataBoxEdgeMonitoringConfig -DeviceName -ResourceGroupName -RoleName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets a metric configuration of a role. + +## 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +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: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RoleName +The role 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeNode.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeNode.md new file mode 100644 index 000000000000..7264795bbd96 --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeNode.md @@ -0,0 +1,123 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgenode +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeNode + +## SYNOPSIS +Gets all the nodes currently configured under this Data Box Edge device + +## SYNTAX + +``` +Get-AzDataBoxEdgeNode -DeviceName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets all the nodes currently configured under this Data Box Edge 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 +``` + +### -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.DataBoxEdge.Models.Api20220301.INode + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeOperationsStatus.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeOperationsStatus.md new file mode 100644 index 000000000000..3d3a3fe6e648 --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeOperationsStatus.md @@ -0,0 +1,179 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeoperationsstatus +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeOperationsStatus + +## SYNOPSIS +Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + +## SYNTAX + +### Get (Default) +``` +Get-AzDataBoxEdgeOperationsStatus -DeviceName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeOperationsStatus -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets the details of a specified job on a Data Box Edge/Data Box Gateway 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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The job 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeOrder.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeOrder.md new file mode 100644 index 000000000000..0522d78f0f37 --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeOrder.md @@ -0,0 +1,169 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeorder +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeOrder + +## SYNOPSIS +Gets a specific order by name. + +## SYNTAX + +### Get (Default) +``` +Get-AzDataBoxEdgeOrder -DeviceName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeOrder -InputObject [-DefaultProfile ] [] +``` + +### List +``` +Get-AzDataBoxEdgeOrder -DeviceName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets a specific order by 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeOrderDcAccessCode.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeOrderDcAccessCode.md new file mode 100644 index 000000000000..24b7166a9486 --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeOrderDcAccessCode.md @@ -0,0 +1,154 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeorderdcaccesscode +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeOrderDcAccessCode + +## SYNOPSIS +Gets the DCAccess Code + +## SYNTAX + +``` +Get-AzDataBoxEdgeOrderDcAccessCode -DeviceName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Gets the DCAccess Code + +## 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 +``` + +### -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.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeRole.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeRole.md new file mode 100644 index 000000000000..73ddad92a180 --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeRole.md @@ -0,0 +1,184 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgerole +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeRole + +## SYNOPSIS +Gets a specific role by name. + +## SYNTAX + +### List (Default) +``` +Get-AzDataBoxEdgeRole -DeviceName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzDataBoxEdgeRole -DeviceName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeRole -InputObject [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets a specific role by 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The role 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, 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeShare.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeShare.md new file mode 100644 index 000000000000..7a3222af27ee --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeShare.md @@ -0,0 +1,184 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeshare +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeShare + +## SYNOPSIS +Gets a share by name. + +## SYNTAX + +### List (Default) +``` +Get-AzDataBoxEdgeShare -DeviceName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzDataBoxEdgeShare -DeviceName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeShare -InputObject [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets a share by 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The 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 +``` + +### -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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeStorageAccount.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeStorageAccount.md new file mode 100644 index 000000000000..4e750cb7c617 --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeStorageAccount.md @@ -0,0 +1,185 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgestorageaccount +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeStorageAccount + +## SYNOPSIS +Gets a StorageAccount by name. + +## SYNTAX + +### List (Default) +``` +Get-AzDataBoxEdgeStorageAccount -DeviceName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzDataBoxEdgeStorageAccount -DeviceName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeStorageAccount -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets a StorageAccount by 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The storage account name. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: StorageAccountName + +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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeStorageAccountCredentials.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeStorageAccountCredentials.md new file mode 100644 index 000000000000..a686ccfd1bdd --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeStorageAccountCredentials.md @@ -0,0 +1,185 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgestorageaccountcredentials +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeStorageAccountCredentials + +## SYNOPSIS +Gets the properties of the specified storage account credential. + +## SYNTAX + +### List (Default) +``` +Get-AzDataBoxEdgeStorageAccountCredentials -DeviceName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzDataBoxEdgeStorageAccountCredentials -DeviceName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeStorageAccountCredentials -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets the properties of the specified 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 + +### -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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The storage account credential 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, 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeTrigger.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeTrigger.md new file mode 100644 index 000000000000..c3ba068a2d02 --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeTrigger.md @@ -0,0 +1,199 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgetrigger +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeTrigger + +## SYNOPSIS +Get a specific trigger by name. + +## SYNTAX + +### List (Default) +``` +Get-AzDataBoxEdgeTrigger -DeviceName -ResourceGroupName [-SubscriptionId ] + [-Filter ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzDataBoxEdgeTrigger -DeviceName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeTrigger -InputObject [-DefaultProfile ] [] +``` + +## DESCRIPTION +Get a specific trigger by 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 +Specify $filter='CustomContextTag eq \' to filter on custom context tag property + +```yaml +Type: System.String +Parameter Sets: List +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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The trigger 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, 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeUser.md b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeUser.md new file mode 100644 index 000000000000..3b50b04d558b --- /dev/null +++ b/swaggerci/databoxedge/docs/Get-AzDataBoxEdgeUser.md @@ -0,0 +1,199 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeuser +schema: 2.0.0 +--- + +# Get-AzDataBoxEdgeUser + +## SYNOPSIS +Gets the properties of the specified user. + +## SYNTAX + +### List (Default) +``` +Get-AzDataBoxEdgeUser -DeviceName -ResourceGroupName [-SubscriptionId ] + [-Filter ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzDataBoxEdgeUser -DeviceName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzDataBoxEdgeUser -InputObject [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the properties of the specified user. + +## 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 +Specify $filter='Type eq \' to filter on user type property + +```yaml +Type: System.String +Parameter Sets: List +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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The user 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, 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Install-AzDataBoxEdgeDeviceUpdate.md b/swaggerci/databoxedge/docs/Install-AzDataBoxEdgeDeviceUpdate.md new file mode 100644 index 000000000000..0293a65f9dc2 --- /dev/null +++ b/swaggerci/databoxedge/docs/Install-AzDataBoxEdgeDeviceUpdate.md @@ -0,0 +1,240 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/install-azdataboxedgedeviceupdate +schema: 2.0.0 +--- + +# Install-AzDataBoxEdgeDeviceUpdate + +## SYNOPSIS +Installs the updates on the Data Box Edge/Data Box Gateway device. + +## SYNTAX + +### Install (Default) +``` +Install-AzDataBoxEdgeDeviceUpdate -DeviceName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### InstallViaIdentity +``` +Install-AzDataBoxEdgeDeviceUpdate -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Installs the updates on the Data Box Edge/Data Box Gateway 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: InstallViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Invoke-AzDataBoxEdgeDownloadDeviceUpdate.md b/swaggerci/databoxedge/docs/Invoke-AzDataBoxEdgeDownloadDeviceUpdate.md new file mode 100644 index 000000000000..12912e8206bb --- /dev/null +++ b/swaggerci/databoxedge/docs/Invoke-AzDataBoxEdgeDownloadDeviceUpdate.md @@ -0,0 +1,241 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/invoke-azdataboxedgedownloaddeviceupdate +schema: 2.0.0 +--- + +# Invoke-AzDataBoxEdgeDownloadDeviceUpdate + +## SYNOPSIS +Downloads the updates on a Data Box Edge/Data Box Gateway device. + +## SYNTAX + +### Download (Default) +``` +Invoke-AzDataBoxEdgeDownloadDeviceUpdate -DeviceName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DownloadViaIdentity +``` +Invoke-AzDataBoxEdgeDownloadDeviceUpdate -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Downloads the updates on a Data Box Edge/Data Box Gateway 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: DownloadViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Invoke-AzDataBoxEdgeScanDevice.md b/swaggerci/databoxedge/docs/Invoke-AzDataBoxEdgeScanDevice.md new file mode 100644 index 000000000000..17c4ccd45dd9 --- /dev/null +++ b/swaggerci/databoxedge/docs/Invoke-AzDataBoxEdgeScanDevice.md @@ -0,0 +1,240 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/invoke-azdataboxedgescandevice +schema: 2.0.0 +--- + +# Invoke-AzDataBoxEdgeScanDevice + +## SYNOPSIS +Scans for updates on a Data Box Edge/Data Box Gateway device. + +## SYNTAX + +### Scan (Default) +``` +Invoke-AzDataBoxEdgeScanDevice -DeviceName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### ScanViaIdentity +``` +Invoke-AzDataBoxEdgeScanDevice -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Scans for updates on a Data Box Edge/Data Box Gateway 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: ScanViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Invoke-AzDataBoxEdgeUploadDeviceCertificate.md b/swaggerci/databoxedge/docs/Invoke-AzDataBoxEdgeUploadDeviceCertificate.md new file mode 100644 index 000000000000..39e84e54349e --- /dev/null +++ b/swaggerci/databoxedge/docs/Invoke-AzDataBoxEdgeUploadDeviceCertificate.md @@ -0,0 +1,262 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/invoke-azdataboxedgeuploaddevicecertificate +schema: 2.0.0 +--- + +# Invoke-AzDataBoxEdgeUploadDeviceCertificate + +## SYNOPSIS +Uploads registration certificate for the device. + +## SYNTAX + +### UploadExpanded (Default) +``` +Invoke-AzDataBoxEdgeUploadDeviceCertificate -DeviceName -ResourceGroupName + -Certificate [-SubscriptionId ] [-AuthenticationType ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### Upload +``` +Invoke-AzDataBoxEdgeUploadDeviceCertificate -DeviceName -ResourceGroupName + -Parameter [-SubscriptionId ] [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +### UploadViaIdentity +``` +Invoke-AzDataBoxEdgeUploadDeviceCertificate -InputObject + -Parameter [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UploadViaIdentityExpanded +``` +Invoke-AzDataBoxEdgeUploadDeviceCertificate -InputObject -Certificate + [-AuthenticationType ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Uploads registration certificate for 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 + +### -AuthenticationType +The authentication type. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType +Parameter Sets: UploadExpanded, UploadViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Certificate +The base64 encoded certificate raw data. + +```yaml +Type: System.String +Parameter Sets: UploadExpanded, UploadViaIdentityExpanded +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: Upload, UploadExpanded +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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: UploadViaIdentity, UploadViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Parameter +The upload certificate request. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest +Parameter Sets: Upload, UploadViaIdentity +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: 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 +``` + +### -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.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +PARAMETER : The upload certificate request. + - `Certificate `: The base64 encoded certificate raw data. + - `[AuthenticationType ]`: The authentication type. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/New-AzDataBoxEdgeAddon.md b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeAddon.md new file mode 100644 index 000000000000..b7946546edb5 --- /dev/null +++ b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeAddon.md @@ -0,0 +1,230 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgeaddon +schema: 2.0.0 +--- + +# New-AzDataBoxEdgeAddon + +## SYNOPSIS +Create or update a addon. + +## SYNTAX + +``` +New-AzDataBoxEdgeAddon -DeviceName -Name -ResourceGroupName -RoleName + -Kind [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Create or update a addon. + +## 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: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Kind +Addon type. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The addon name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: AddonName + +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 +``` + +### -RoleName +The role 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.DataBoxEdge.Models.Api20220301.IAddon + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/New-AzDataBoxEdgeBandwidthSchedule.md b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeBandwidthSchedule.md new file mode 100644 index 000000000000..c7f1a6262224 --- /dev/null +++ b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeBandwidthSchedule.md @@ -0,0 +1,260 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgebandwidthschedule +schema: 2.0.0 +--- + +# New-AzDataBoxEdgeBandwidthSchedule + +## SYNOPSIS +Creates or updates a bandwidth schedule. + +## SYNTAX + +``` +New-AzDataBoxEdgeBandwidthSchedule -DeviceName -Name -ResourceGroupName + -Day -RateInMbps -Start -Stop [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates a bandwidth schedule. + +## 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 +``` + +### -Day +The days of the week when this schedule is applicable. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek[] +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 +``` + +### -Name +The bandwidth schedule name which needs to be added/updated. + +```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 +``` + +### -RateInMbps +The bandwidth rate in Mbps. + +```yaml +Type: System.Int32 +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 +``` + +### -Start +The start time of the schedule in UTC. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Stop +The stop time of the schedule in UTC. + +```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.DataBoxEdge.Models.Api20220301.IBandwidthSchedule + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/New-AzDataBoxEdgeContainer.md b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeContainer.md new file mode 100644 index 000000000000..1956ec5dc2f9 --- /dev/null +++ b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeContainer.md @@ -0,0 +1,230 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgecontainer +schema: 2.0.0 +--- + +# New-AzDataBoxEdgeContainer + +## SYNOPSIS +Creates a new container or updates an existing container on the device. + +## SYNTAX + +``` +New-AzDataBoxEdgeContainer -DeviceName -Name -ResourceGroupName + -StorageAccountName -DataFormat [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates a new container or updates an existing container 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 +``` + +### -DataFormat +DataFormat for Container + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat +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 +``` + +### -Name +The container name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: ContainerName + +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 +``` + +### -StorageAccountName +The Storage Account 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.DataBoxEdge.Models.Api20220301.IContainer + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/New-AzDataBoxEdgeDevice.md b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeDevice.md new file mode 100644 index 000000000000..e02889722911 --- /dev/null +++ b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeDevice.md @@ -0,0 +1,265 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgedevice +schema: 2.0.0 +--- + +# New-AzDataBoxEdgeDevice + +## SYNOPSIS +Creates or updates a Data Box Edge/Data Box Gateway resource. + +## SYNTAX + +``` +New-AzDataBoxEdgeDevice -Name -ResourceGroupName -Location + [-SubscriptionId ] [-DataResidencyType ] [-Etag ] + [-IdentityType ] [-SkuName ] [-SkuTier ] [-Tag ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates a Data Box Edge/Data Box Gateway resource. + +## 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 + +### -DataResidencyType +DataResidencyType enum + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType +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 +The etag for the devices. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityType +Identity type + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +The location of the device. +This is a supported and registered Azure geographical region (for example, West US, East US, or Southeast Asia). +The geographical region of a device cannot be changed once it is created, but if an identical geographical region is specified on update, the request will succeed. + +```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 device name. + +```yaml +Type: System.String +Parameter Sets: (All) +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: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuName +SKU name. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuTier +The SKU tier. +This is based on the SKU name. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier +Parameter Sets: (All) +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: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +The list of tags that describe the device. +These tags can be used to view and group this device (across resource groups). + +```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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/New-AzDataBoxEdgeDeviceCertificate.md b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeDeviceCertificate.md new file mode 100644 index 000000000000..ff6c67193842 --- /dev/null +++ b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeDeviceCertificate.md @@ -0,0 +1,195 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgedevicecertificate +schema: 2.0.0 +--- + +# New-AzDataBoxEdgeDeviceCertificate + +## SYNOPSIS +Generates certificate for activation key. + +## SYNTAX + +### Generate (Default) +``` +New-AzDataBoxEdgeDeviceCertificate -DeviceName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### GenerateViaIdentity +``` +New-AzDataBoxEdgeDeviceCertificate -InputObject [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Generates certificate for activation key. + +## 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: Generate +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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: GenerateViaIdentity +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: Generate +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: Generate +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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponse + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/New-AzDataBoxEdgeDeviceSecuritySetting.md b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeDeviceSecuritySetting.md new file mode 100644 index 000000000000..ecadb7797e9a --- /dev/null +++ b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeDeviceSecuritySetting.md @@ -0,0 +1,247 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgedevicesecuritysetting +schema: 2.0.0 +--- + +# New-AzDataBoxEdgeDeviceSecuritySetting + +## SYNOPSIS +Updates the security settings on a Data Box Edge/Data Box Gateway device. + +## SYNTAX + +``` +New-AzDataBoxEdgeDeviceSecuritySetting -DeviceName -ResourceGroupName + -DeviceAdminPasswordEncryptionAlgorithm -DeviceAdminPasswordValue + [-SubscriptionId ] [-DeviceAdminPasswordEncryptionCertThumbprint ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Updates the security settings on a Data Box Edge/Data Box Gateway 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 +``` + +### -DeviceAdminPasswordEncryptionAlgorithm +The algorithm used to encrypt "Value". + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceAdminPasswordEncryptionCertThumbprint +Thumbprint certificate used to encrypt \"Value\". +If the value is unencrypted, it 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 +``` + +### -DeviceAdminPasswordValue +The value of the secret. + +```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 +``` + +### -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/databoxedge/docs/New-AzDataBoxEdgeMonitoringConfig.md b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeMonitoringConfig.md new file mode 100644 index 000000000000..2b8ff21a7818 --- /dev/null +++ b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeMonitoringConfig.md @@ -0,0 +1,234 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgemonitoringconfig +schema: 2.0.0 +--- + +# New-AzDataBoxEdgeMonitoringConfig + +## SYNOPSIS +Creates a new metric configuration or updates an existing one for a role. + +## SYNTAX + +``` +New-AzDataBoxEdgeMonitoringConfig -DeviceName -ResourceGroupName -RoleName + -MetricConfiguration [-SubscriptionId ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates a new metric configuration or updates an existing one for a role. + +## 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: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MetricConfiguration +The metrics configuration details +To construct, see NOTES section for METRICCONFIGURATION properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration[] +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 +``` + +### -RoleName +The role 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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration + +## 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. + + +METRICCONFIGURATION : The metrics configuration details + - `CounterSet `: Host name for the IoT hub associated to the device. + - `Counter `: The counters that should be collected in this set. + - `Name `: The counter name. + - `[AdditionalDimension ]`: The additional dimensions to be added to metric. + - `SourceName `: The dimension value. + - `SourceType `: The dimension type. + - `[DimensionFilter ]`: The dimension filter. + - `[Instance ]`: The instance from which counter should be collected. + - `ResourceId `: The Resource ID on which the metrics should be pushed. + - `[MdmAccount ]`: The MDM account to which the counters should be pushed. + - `[MetricNameSpace ]`: The MDM namespace to which the counters should be pushed. This is required if MDMAccount is specified + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/New-AzDataBoxEdgeOrder.md b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeOrder.md new file mode 100644 index 000000000000..51dfa9b5e2bd --- /dev/null +++ b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeOrder.md @@ -0,0 +1,369 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgeorder +schema: 2.0.0 +--- + +# New-AzDataBoxEdgeOrder + +## SYNOPSIS +Creates or updates an order. + +## SYNTAX + +``` +New-AzDataBoxEdgeOrder -DeviceName -ResourceGroupName [-SubscriptionId ] + [-ContactInformationCompanyName ] [-ContactInformationContactPerson ] + [-ContactInformationEmailList ] [-ContactInformationPhone ] [-ShipmentType ] + [-ShippingAddressCity ] [-ShippingAddressCountry ] [-ShippingAddressLine1 ] + [-ShippingAddressLine2 ] [-ShippingAddressLine3 ] [-ShippingAddressPostalCode ] + [-ShippingAddressState ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Creates or updates an order. + +## 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 +``` + +### -ContactInformationCompanyName +The name of the company. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContactInformationContactPerson +The contact person name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContactInformationEmailList +The email list. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContactInformationPhone +The phone number. + +```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 +``` + +### -DeviceName +The order details of a device. + +```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 +``` + +### -ShipmentType +ShipmentType of the order + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShippingAddressCity +The city name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShippingAddressCountry +The country name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShippingAddressLine1 +The address line1. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShippingAddressLine2 +The address line2. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShippingAddressLine3 +The address line3. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShippingAddressPostalCode +The postal code. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShippingAddressState +The state name. + +```yaml +Type: System.String +Parameter Sets: (All) +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: (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.DataBoxEdge.Models.Api20220301.IOrder + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/New-AzDataBoxEdgeRole.md b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeRole.md new file mode 100644 index 000000000000..c74b4909800b --- /dev/null +++ b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeRole.md @@ -0,0 +1,215 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgerole +schema: 2.0.0 +--- + +# New-AzDataBoxEdgeRole + +## SYNOPSIS +Create or update a role. + +## SYNTAX + +``` +New-AzDataBoxEdgeRole -DeviceName -Name -ResourceGroupName -Kind + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Create or update a role. + +## 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: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Kind +Role type. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The role 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.DataBoxEdge.Models.Api20220301.IRole + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/New-AzDataBoxEdgeShare.md b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeShare.md new file mode 100644 index 000000000000..1ef3a1224d95 --- /dev/null +++ b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeShare.md @@ -0,0 +1,434 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgeshare +schema: 2.0.0 +--- + +# New-AzDataBoxEdgeShare + +## SYNOPSIS +Creates a new share or updates an existing share on the device. + +## SYNTAX + +``` +New-AzDataBoxEdgeShare -DeviceName -Name -ResourceGroupName + -AccessProtocol -MonitoringStatus -ShareStatus + [-SubscriptionId ] [-AzureContainerInfoContainerName ] + [-AzureContainerInfoDataFormat ] + [-AzureContainerInfoStorageAccountCredentialId ] [-ClientAccessRights ] + [-DataPolicy ] [-Description ] [-RefreshDetailErrorManifestFile ] + [-RefreshDetailInProgressRefreshJobId ] [-RefreshDetailLastCompletedRefreshJobTimeInUtc ] + [-RefreshDetailLastJob ] [-UserAccessRights ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates a new share or updates an existing share 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 + +### -AccessProtocol +Access protocol to be used by the share. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol +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 +``` + +### -AzureContainerInfoContainerName +Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob). + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureContainerInfoDataFormat +Storage format used for the file represented by the share. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureContainerInfoStorageAccountCredentialId +ID of the storage account credential used to access storage. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ClientAccessRights +List of IP addresses and corresponding access rights on the share(required for NFS protocol). +To construct, see NOTES section for CLIENTACCESSRIGHTS properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DataPolicy +Data policy of the share. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy +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 +Description for the 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 +``` + +### -MonitoringStatus +Current monitoring status of the share. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The 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 +``` + +### -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 +``` + +### -RefreshDetailErrorManifestFile +Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. +This could be a failed job or a successful job. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RefreshDetailInProgressRefreshJobId +If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that job. +The field is empty if no job is in progress. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RefreshDetailLastCompletedRefreshJobTimeInUtc +Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed job or a successful job. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RefreshDetailLastJob +Indicates the id of the last refresh job on this particular share or container,if any. +This could be a failed job or a successful job. + +```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 +``` + +### -ShareStatus +Current status of the share. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 +``` + +### -UserAccessRights +Mapping of users and corresponding access rights on the share (required for SMB protocol). +To construct, see NOTES section for USERACCESSRIGHTS properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight[] +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.DataBoxEdge.Models.Api20220301.IShare + +## 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. + + +CLIENTACCESSRIGHTS : List of IP addresses and corresponding access rights on the share(required for NFS protocol). + - `AccessPermission `: Type of access to be allowed for the client. + - `Client `: IP of the client. + +USERACCESSRIGHTS : Mapping of users and corresponding access rights on the share (required for SMB protocol). + - `AccessType `: Type of access to be allowed for the user. + - `UserId `: User ID (already existing in the device). + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/New-AzDataBoxEdgeStorageAccount.md b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeStorageAccount.md new file mode 100644 index 000000000000..00ed83cf1a76 --- /dev/null +++ b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeStorageAccount.md @@ -0,0 +1,261 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgestorageaccount +schema: 2.0.0 +--- + +# New-AzDataBoxEdgeStorageAccount + +## SYNOPSIS +Creates a new StorageAccount or updates an existing StorageAccount on the device. + +## SYNTAX + +``` +New-AzDataBoxEdgeStorageAccount -DeviceName -Name -ResourceGroupName + -DataPolicy [-SubscriptionId ] [-Description ] + [-StorageAccountCredentialId ] [-StorageAccountStatus ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates a new StorageAccount or updates an existing StorageAccount 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 +``` + +### -DataPolicy +Data policy of the storage Account. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 the storage Account. + +```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 +``` + +### -Name +The StorageAccount name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: StorageAccountName + +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 +Storage Account Credential Id + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageAccountStatus +Current status of the storage account + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus +Parameter Sets: (All) +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: (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.DataBoxEdge.Models.Api20220301.IStorageAccount + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/New-AzDataBoxEdgeStorageAccountCredentials.md b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeStorageAccountCredentials.md new file mode 100644 index 000000000000..6a7f37358db1 --- /dev/null +++ b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeStorageAccountCredentials.md @@ -0,0 +1,355 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgestorageaccountcredentials +schema: 2.0.0 +--- + +# New-AzDataBoxEdgeStorageAccountCredentials + +## SYNOPSIS +Creates or updates the storage account credential. + +## SYNTAX + +``` +New-AzDataBoxEdgeStorageAccountCredentials -DeviceName -Name -ResourceGroupName + -AccountType -Alias -SslStatus [-SubscriptionId ] + [-AccountKeyEncryptionAlgorithm ] [-AccountKeyEncryptionCertThumbprint ] + [-AccountKeyValue ] [-BlobDomainName ] [-ConnectionString ] + [-StorageAccountId ] [-UserName ] [-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 + +### -AccountKeyEncryptionAlgorithm +The algorithm used to encrypt "Value". + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AccountKeyEncryptionCertThumbprint +Thumbprint certificate used to encrypt \"Value\". +If the value is unencrypted, it 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 +``` + +### -AccountKeyValue +The value of the secret. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AccountType +Type of storage accessed on the storage account. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Alias +Alias for the storage account. + +```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 +``` + +### -BlobDomainName +Blob end point for private clouds. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ConnectionString +Connection string for the storage account. +Use this string if username and account key are not specified. + +```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 +``` + +### -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 +``` + +### -Name +The storage account 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 +``` + +### -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 +``` + +### -SslStatus +Signifies whether SSL needs to be enabled or not. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageAccountId +Id of the storage account. + +```yaml +Type: System.String +Parameter Sets: (All) +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: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -UserName +Username for the storage account. + +```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.DataBoxEdge.Models.Api20220301.IStorageAccountCredential + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/New-AzDataBoxEdgeTrigger.md b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeTrigger.md new file mode 100644 index 000000000000..ed7ee08d2211 --- /dev/null +++ b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeTrigger.md @@ -0,0 +1,215 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgetrigger +schema: 2.0.0 +--- + +# New-AzDataBoxEdgeTrigger + +## SYNOPSIS +Creates or updates a trigger. + +## SYNTAX + +``` +New-AzDataBoxEdgeTrigger -DeviceName -Name -ResourceGroupName + -Kind [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates a trigger. + +## 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 +Creates or updates a trigger + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Kind +Trigger Kind. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The trigger 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.DataBoxEdge.Models.Api20220301.ITrigger + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/New-AzDataBoxEdgeUser.md b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeUser.md new file mode 100644 index 000000000000..17b1d89b0993 --- /dev/null +++ b/swaggerci/databoxedge/docs/New-AzDataBoxEdgeUser.md @@ -0,0 +1,262 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgeuser +schema: 2.0.0 +--- + +# New-AzDataBoxEdgeUser + +## SYNOPSIS +Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + +## SYNTAX + +``` +New-AzDataBoxEdgeUser -DeviceName -Name -ResourceGroupName -UserType + [-SubscriptionId ] [-EncryptedPasswordEncryptionAlgorithm ] + [-EncryptedPasswordEncryptionCertThumbprint ] [-EncryptedPasswordValue ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway 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: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EncryptedPasswordEncryptionAlgorithm +The algorithm used to encrypt "Value". + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EncryptedPasswordEncryptionCertThumbprint +Thumbprint certificate used to encrypt \"Value\". +If the value is unencrypted, it 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 +``` + +### -EncryptedPasswordValue +The value of the secret. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The 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 +``` + +### -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 +``` + +### -UserType +Type of the user. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType +Parameter Sets: (All) +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 + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/README.md b/swaggerci/databoxedge/docs/README.md new file mode 100644 index 000000000000..fd7aa28da991 --- /dev/null +++ b/swaggerci/databoxedge/docs/README.md @@ -0,0 +1,11 @@ +# Docs +This directory contains the documentation of the cmdlets for the `Az.DataBoxEdge` 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.DataBoxEdge` 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/databoxedge/docs/Remove-AzDataBoxEdgeAddon.md b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeAddon.md new file mode 100644 index 000000000000..09e1a6960f1d --- /dev/null +++ b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeAddon.md @@ -0,0 +1,271 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgeaddon +schema: 2.0.0 +--- + +# Remove-AzDataBoxEdgeAddon + +## SYNOPSIS +Deletes the addon on the device. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzDataBoxEdgeAddon -DeviceName -Name -ResourceGroupName -RoleName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataBoxEdgeAddon -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the addon 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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The addon name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: AddonName + +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 +``` + +### -RoleName +The role 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeBandwidthSchedule.md b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeBandwidthSchedule.md new file mode 100644 index 000000000000..0713179dd23a --- /dev/null +++ b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeBandwidthSchedule.md @@ -0,0 +1,256 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgebandwidthschedule +schema: 2.0.0 +--- + +# Remove-AzDataBoxEdgeBandwidthSchedule + +## SYNOPSIS +Deletes the specified bandwidth schedule. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzDataBoxEdgeBandwidthSchedule -DeviceName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataBoxEdgeBandwidthSchedule -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the specified bandwidth schedule. + +## 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The bandwidth schedule 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeContainer.md b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeContainer.md new file mode 100644 index 000000000000..646e703f2339 --- /dev/null +++ b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeContainer.md @@ -0,0 +1,271 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgecontainer +schema: 2.0.0 +--- + +# Remove-AzDataBoxEdgeContainer + +## SYNOPSIS +Deletes the container on the Data Box Edge/Data Box Gateway device. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzDataBoxEdgeContainer -DeviceName -Name -ResourceGroupName + -StorageAccountName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataBoxEdgeContainer -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the container on the Data Box Edge/Data Box Gateway 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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The container name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: ContainerName + +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 +``` + +### -StorageAccountName +The Storage Account 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeDevice.md b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeDevice.md new file mode 100644 index 000000000000..2cf3b6faf771 --- /dev/null +++ b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeDevice.md @@ -0,0 +1,240 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgedevice +schema: 2.0.0 +--- + +# Remove-AzDataBoxEdgeDevice + +## SYNOPSIS +Deletes the Data Box Edge/Data Box Gateway device. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzDataBoxEdgeDevice -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataBoxEdgeDevice -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the Data Box Edge/Data Box Gateway 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeMonitoringConfig.md b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeMonitoringConfig.md new file mode 100644 index 000000000000..a01dd38155c9 --- /dev/null +++ b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeMonitoringConfig.md @@ -0,0 +1,256 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgemonitoringconfig +schema: 2.0.0 +--- + +# Remove-AzDataBoxEdgeMonitoringConfig + +## SYNOPSIS +deletes a new metric configuration for a role. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzDataBoxEdgeMonitoringConfig -DeviceName -ResourceGroupName -RoleName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataBoxEdgeMonitoringConfig -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +deletes a new metric configuration for a role. + +## 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +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 +``` + +### -RoleName +The role 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeOrder.md b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeOrder.md new file mode 100644 index 000000000000..24e47a9f1b62 --- /dev/null +++ b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeOrder.md @@ -0,0 +1,240 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgeorder +schema: 2.0.0 +--- + +# Remove-AzDataBoxEdgeOrder + +## SYNOPSIS +Deletes the order related to the device. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzDataBoxEdgeOrder -DeviceName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataBoxEdgeOrder -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the order related to 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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeRole.md b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeRole.md new file mode 100644 index 000000000000..b8dfd87c7cf0 --- /dev/null +++ b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeRole.md @@ -0,0 +1,256 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgerole +schema: 2.0.0 +--- + +# Remove-AzDataBoxEdgeRole + +## SYNOPSIS +Deletes the role on the device. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzDataBoxEdgeRole -DeviceName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataBoxEdgeRole -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the role 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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The role 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeShare.md b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeShare.md new file mode 100644 index 000000000000..ad409074e8da --- /dev/null +++ b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeShare.md @@ -0,0 +1,256 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgeshare +schema: 2.0.0 +--- + +# Remove-AzDataBoxEdgeShare + +## SYNOPSIS +Deletes the share on the Data Box Edge/Data Box Gateway device. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzDataBoxEdgeShare -DeviceName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataBoxEdgeShare -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the share on the Data Box Edge/Data Box Gateway 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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The 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 +``` + +### -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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeStorageAccount.md b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeStorageAccount.md new file mode 100644 index 000000000000..2080bc2eaa1b --- /dev/null +++ b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeStorageAccount.md @@ -0,0 +1,256 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgestorageaccount +schema: 2.0.0 +--- + +# Remove-AzDataBoxEdgeStorageAccount + +## SYNOPSIS +Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzDataBoxEdgeStorageAccount -DeviceName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataBoxEdgeStorageAccount -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the StorageAccount on the Data Box Edge/Data Box Gateway 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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The StorageAccount name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: StorageAccountName + +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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeStorageAccountCredentials.md b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeStorageAccountCredentials.md new file mode 100644 index 000000000000..6194d758bcae --- /dev/null +++ b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeStorageAccountCredentials.md @@ -0,0 +1,256 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgestorageaccountcredentials +schema: 2.0.0 +--- + +# Remove-AzDataBoxEdgeStorageAccountCredentials + +## SYNOPSIS +Deletes the storage account credential. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzDataBoxEdgeStorageAccountCredentials -DeviceName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataBoxEdgeStorageAccountCredentials -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 +``` + +### -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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The storage account credential 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeTrigger.md b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeTrigger.md new file mode 100644 index 000000000000..6720b6e95f86 --- /dev/null +++ b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeTrigger.md @@ -0,0 +1,256 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgetrigger +schema: 2.0.0 +--- + +# Remove-AzDataBoxEdgeTrigger + +## SYNOPSIS +Deletes the trigger on the gateway device. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzDataBoxEdgeTrigger -DeviceName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataBoxEdgeTrigger -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the trigger on the gateway 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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The trigger 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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeUser.md b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeUser.md new file mode 100644 index 000000000000..5d19bc2003b9 --- /dev/null +++ b/swaggerci/databoxedge/docs/Remove-AzDataBoxEdgeUser.md @@ -0,0 +1,256 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgeuser +schema: 2.0.0 +--- + +# Remove-AzDataBoxEdgeUser + +## SYNOPSIS +Deletes the user on a databox edge/gateway device. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzDataBoxEdgeUser -DeviceName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzDataBoxEdgeUser -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the user on a databox edge/gateway 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: 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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The 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 +``` + +### -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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Start-AzDataBoxEdgeSupportPackage.md b/swaggerci/databoxedge/docs/Start-AzDataBoxEdgeSupportPackage.md new file mode 100644 index 000000000000..827708620519 --- /dev/null +++ b/swaggerci/databoxedge/docs/Start-AzDataBoxEdgeSupportPackage.md @@ -0,0 +1,324 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/start-azdataboxedgesupportpackage +schema: 2.0.0 +--- + +# Start-AzDataBoxEdgeSupportPackage + +## SYNOPSIS +Triggers support package on the device + +## SYNTAX + +### TriggerExpanded (Default) +``` +Start-AzDataBoxEdgeSupportPackage -DeviceName -ResourceGroupName [-SubscriptionId ] + [-Include ] [-MaximumTimeStamp ] [-MinimumTimeStamp ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### Trigger +``` +Start-AzDataBoxEdgeSupportPackage -DeviceName -ResourceGroupName + -TriggerSupportPackageRequest [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### TriggerViaIdentity +``` +Start-AzDataBoxEdgeSupportPackage -InputObject + -TriggerSupportPackageRequest [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### TriggerViaIdentityExpanded +``` +Start-AzDataBoxEdgeSupportPackage -InputObject [-Include ] + [-MaximumTimeStamp ] [-MinimumTimeStamp ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Triggers support package 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: Trigger, TriggerExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Include +Type of files, which need to be included in the logsThis will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived)or a comma separated list of log types that are required + +```yaml +Type: System.String +Parameter Sets: TriggerExpanded, TriggerViaIdentityExpanded +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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: TriggerViaIdentity, TriggerViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -MaximumTimeStamp +Start of the timespan of the log collection + +```yaml +Type: System.DateTime +Parameter Sets: TriggerExpanded, TriggerViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MinimumTimeStamp +MinimumTimeStamp from where logs need to be collected + +```yaml +Type: System.DateTime +Parameter Sets: TriggerExpanded, TriggerViaIdentityExpanded +Aliases: + +Required: False +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: Trigger, TriggerExpanded +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: Trigger, TriggerExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TriggerSupportPackageRequest +The request object for trigger support package. +To construct, see NOTES section for TRIGGERSUPPORTPACKAGEREQUEST properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest +Parameter Sets: Trigger, TriggerViaIdentity +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.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +TRIGGERSUPPORTPACKAGEREQUEST : The request object for trigger support package. + - `[Include ]`: Type of files, which need to be included in the logs This will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) or a comma separated list of log types that are required + - `[MaximumTimeStamp ]`: Start of the timespan of the log collection + - `[MinimumTimeStamp ]`: MinimumTimeStamp from where logs need to be collected + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility.md b/swaggerci/databoxedge/docs/Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility.md new file mode 100644 index 000000000000..f151d7a61d33 --- /dev/null +++ b/swaggerci/databoxedge/docs/Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility.md @@ -0,0 +1,336 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/test-azdataboxedgedevicecapacitycheckresourcecreationfeasibility +schema: 2.0.0 +--- + +# Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility + +## SYNOPSIS +Posts the device capacity request info to check feasibility. + +## SYNTAX + +### CheckExpanded (Default) +``` +Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility -DeviceName + -ResourceGroupName -VMPlacementQuery [-SubscriptionId ] + [-CapacityName ] [-VMPlacementResult ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### Check +``` +Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility -DeviceName + -ResourceGroupName -DeviceCapacityRequestInfo + [-SubscriptionId ] [-CapacityName ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### CheckViaIdentity +``` +Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility -InputObject + -DeviceCapacityRequestInfo [-CapacityName ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### CheckViaIdentityExpanded +``` +Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility -InputObject + -VMPlacementQuery [-CapacityName ] [-VMPlacementResult ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Posts the device capacity request info to check feasibility. + +## 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 +``` + +### -CapacityName +The capacity name. + +```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 +``` + +### -DeviceCapacityRequestInfo +Object for Capturing DeviceCapacityRequestInfo +To construct, see NOTES section for DEVICECAPACITYREQUESTINFO properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo +Parameter Sets: Check, CheckViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Check, CheckExpanded +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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: CheckViaIdentity, CheckViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +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: Check, CheckExpanded +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: Check, CheckExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VMPlacementQuery +Array containing the sizes of the VMs for checking if its feasible to create them on the appliance. + +```yaml +Type: System.String[][] +Parameter Sets: CheckExpanded, CheckViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VMPlacementResult +Array of the VMs of the sizes in VmSizes can be provisioned on the appliance. +To construct, see NOTES section for VMPLACEMENTRESULT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult[] +Parameter Sets: CheckExpanded, CheckViaIdentityExpanded +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.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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. + + +DEVICECAPACITYREQUESTINFO : Object for Capturing DeviceCapacityRequestInfo + - `VMPlacementQuery `: Array containing the sizes of the VMs for checking if its feasible to create them on the appliance. + - `[VMPlacementResult ]`: Array of the VMs of the sizes in VmSizes can be provisioned on the appliance. + - `[IsFeasible ]`: Boolean value indicating if the VM(s) in VmSize can be created. + - `[Message ]`: Localized message to be displayed to the user to explain the check result. + - `[MessageCode ]`: MessageCode indicating reason for success or failure. + - `[VMSize ]`: List of VM sizes being checked. + +INPUTOBJECT : Identity Parameter + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +VMPLACEMENTRESULT : Array of the VMs of the sizes in VmSizes can be provisioned on the appliance. + - `[IsFeasible ]`: Boolean value indicating if the VM(s) in VmSize can be created. + - `[Message ]`: Localized message to be displayed to the user to explain the check result. + - `[MessageCode ]`: MessageCode indicating reason for success or failure. + - `[VMSize ]`: List of VM sizes being checked. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Update-AzDataBoxEdgeContainer.md b/swaggerci/databoxedge/docs/Update-AzDataBoxEdgeContainer.md new file mode 100644 index 000000000000..c275d48fff7c --- /dev/null +++ b/swaggerci/databoxedge/docs/Update-AzDataBoxEdgeContainer.md @@ -0,0 +1,271 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/update-azdataboxedgecontainer +schema: 2.0.0 +--- + +# Update-AzDataBoxEdgeContainer + +## SYNOPSIS +Refreshes the container metadata with the data from the cloud. + +## SYNTAX + +### Refresh (Default) +``` +Update-AzDataBoxEdgeContainer -DeviceName -Name -ResourceGroupName + -StorageAccountName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### RefreshViaIdentity +``` +Update-AzDataBoxEdgeContainer -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Refreshes the container metadata with the data from the cloud. + +## 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: Refresh +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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: RefreshViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The container name. + +```yaml +Type: System.String +Parameter Sets: Refresh +Aliases: ContainerName + +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: Refresh +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageAccountName +The Storage Account Name + +```yaml +Type: System.String +Parameter Sets: Refresh +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: Refresh +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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Update-AzDataBoxEdgeDevice.md b/swaggerci/databoxedge/docs/Update-AzDataBoxEdgeDevice.md new file mode 100644 index 000000000000..fef55a42f51b --- /dev/null +++ b/swaggerci/databoxedge/docs/Update-AzDataBoxEdgeDevice.md @@ -0,0 +1,242 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/update-azdataboxedgedevice +schema: 2.0.0 +--- + +# Update-AzDataBoxEdgeDevice + +## SYNOPSIS +Modifies a Data Box Edge/Data Box Gateway resource. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzDataBoxEdgeDevice -Name -ResourceGroupName [-SubscriptionId ] + [-IdentityType ] [-PropertiesEdgeProfileSubscriptionId ] [-Tag ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzDataBoxEdgeDevice -InputObject [-SubscriptionId ] + [-IdentityType ] [-Tag ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Modifies a Data Box Edge/Data Box Gateway resource. + +## 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 +``` + +### -IdentityType +Identity type + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType +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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The device name. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: DeviceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PropertiesEdgeProfileSubscriptionId +The path ID that uniquely identifies the subscription of the edge profile. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +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: (All) +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 Data Box Edge/Gateway resource. + +```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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Update-AzDataBoxEdgeDeviceExtendedInformation.md b/swaggerci/databoxedge/docs/Update-AzDataBoxEdgeDeviceExtendedInformation.md new file mode 100644 index 000000000000..807682d198e8 --- /dev/null +++ b/swaggerci/databoxedge/docs/Update-AzDataBoxEdgeDeviceExtendedInformation.md @@ -0,0 +1,274 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/update-azdataboxedgedeviceextendedinformation +schema: 2.0.0 +--- + +# Update-AzDataBoxEdgeDeviceExtendedInformation + +## SYNOPSIS +Gets additional information for the specified Data Box Edge/Data Box Gateway device. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzDataBoxEdgeDeviceExtendedInformation -DeviceName -ResourceGroupName + [-SubscriptionId ] [-ChannelIntegrityKeyName ] [-ChannelIntegrityKeyVersion ] + [-ClientSecretStoreId ] [-ClientSecretStoreUrl ] [-SyncStatus ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzDataBoxEdgeDeviceExtendedInformation -InputObject + [-ChannelIntegrityKeyName ] [-ChannelIntegrityKeyVersion ] [-ClientSecretStoreId ] + [-ClientSecretStoreUrl ] [-SyncStatus ] [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Gets additional information for the specified Data Box Edge/Data Box Gateway 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 + +### -ChannelIntegrityKeyName +The name for Channel Integrity Key stored in the Client Key Vault + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ChannelIntegrityKeyVersion +The version of Channel Integrity Key stored in the Client Key Vault + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ClientSecretStoreId +The Key Vault ARM Id for client secrets + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ClientSecretStoreUrl +The url to access the Client Key Vault + +```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 +``` + +### -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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: UpdateViaIdentityExpanded +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: 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 +``` + +### -SyncStatus +For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status will not be applicable. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus +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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Update-AzDataBoxEdgeDeviceSecuritySetting.md b/swaggerci/databoxedge/docs/Update-AzDataBoxEdgeDeviceSecuritySetting.md new file mode 100644 index 000000000000..6f320b1ed8a2 --- /dev/null +++ b/swaggerci/databoxedge/docs/Update-AzDataBoxEdgeDeviceSecuritySetting.md @@ -0,0 +1,290 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/update-azdataboxedgedevicesecuritysetting +schema: 2.0.0 +--- + +# Update-AzDataBoxEdgeDeviceSecuritySetting + +## SYNOPSIS +Updates the security settings on a Data Box Edge/Data Box Gateway device. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzDataBoxEdgeDeviceSecuritySetting -DeviceName -ResourceGroupName + -DeviceAdminPasswordEncryptionAlgorithm -DeviceAdminPasswordValue + [-SubscriptionId ] [-DeviceAdminPasswordEncryptionCertThumbprint ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzDataBoxEdgeDeviceSecuritySetting -InputObject + -DeviceAdminPasswordEncryptionAlgorithm -DeviceAdminPasswordValue + [-DeviceAdminPasswordEncryptionCertThumbprint ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Updates the security settings on a Data Box Edge/Data Box Gateway 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 +``` + +### -DeviceAdminPasswordEncryptionAlgorithm +The algorithm used to encrypt "Value". + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceAdminPasswordEncryptionCertThumbprint +Thumbprint certificate used to encrypt \"Value\". +If the value is unencrypted, it 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 +``` + +### -DeviceAdminPasswordValue +The value of the secret. + +```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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/docs/Update-AzDataBoxEdgeShare.md b/swaggerci/databoxedge/docs/Update-AzDataBoxEdgeShare.md new file mode 100644 index 000000000000..28d07f6fb644 --- /dev/null +++ b/swaggerci/databoxedge/docs/Update-AzDataBoxEdgeShare.md @@ -0,0 +1,256 @@ +--- +external help file: +Module Name: Az.DataBoxEdge +online version: https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/update-azdataboxedgeshare +schema: 2.0.0 +--- + +# Update-AzDataBoxEdgeShare + +## SYNOPSIS +Refreshes the share metadata with the data from the cloud. + +## SYNTAX + +### Refresh (Default) +``` +Update-AzDataBoxEdgeShare -DeviceName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### RefreshViaIdentity +``` +Update-AzDataBoxEdgeShare -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Refreshes the share metadata with the data from the cloud. + +## 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: Refresh +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.DataBoxEdge.Models.IDataBoxEdgeIdentity +Parameter Sets: RefreshViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The share name. + +```yaml +Type: System.String +Parameter Sets: Refresh +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: Refresh +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: Refresh +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.DataBoxEdge.Models.IDataBoxEdgeIdentity + +## 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 + - `[AddonName ]`: The addon name. + - `[ContainerName ]`: The container Name + - `[DeviceName ]`: The device name. + - `[Id ]`: Resource identity path + - `[Name ]`: The alert name. + - `[ResourceGroupName ]`: The resource group name. + - `[RoleName ]`: The role name. + - `[StorageAccountName ]`: The storage account name. + - `[SubscriptionId ]`: The subscription ID. + +## RELATED LINKS + diff --git a/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeAddon.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeAddon.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeAddon.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/databoxedge/examples/Get-AzDataBoxEdgeAlert.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeAlert.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeAlert.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/databoxedge/examples/Get-AzDataBoxEdgeAvailableSku.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeAvailableSku.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeAvailableSku.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/databoxedge/examples/Get-AzDataBoxEdgeBandwidthSchedule.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeBandwidthSchedule.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeBandwidthSchedule.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/databoxedge/examples/Get-AzDataBoxEdgeContainer.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeContainer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeContainer.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/databoxedge/examples/Get-AzDataBoxEdgeDevice.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeDevice.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeDevice.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/databoxedge/examples/Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo.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/databoxedge/examples/Get-AzDataBoxEdgeDeviceExtendedInformation.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeDeviceExtendedInformation.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeDeviceExtendedInformation.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/databoxedge/examples/Get-AzDataBoxEdgeDeviceNetworkSetting.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeDeviceNetworkSetting.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeDeviceNetworkSetting.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/databoxedge/examples/Get-AzDataBoxEdgeDeviceUpdateSummary.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeDeviceUpdateSummary.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeDeviceUpdateSummary.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/databoxedge/examples/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting.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/databoxedge/examples/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting.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/databoxedge/examples/Get-AzDataBoxEdgeJob.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeJob.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeJob.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/databoxedge/examples/Get-AzDataBoxEdgeMonitoringConfig.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeMonitoringConfig.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeMonitoringConfig.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/databoxedge/examples/Get-AzDataBoxEdgeNode.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeNode.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeNode.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/databoxedge/examples/Get-AzDataBoxEdgeOperationsStatus.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeOperationsStatus.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeOperationsStatus.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/databoxedge/examples/Get-AzDataBoxEdgeOrder.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeOrder.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeOrder.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/databoxedge/examples/Get-AzDataBoxEdgeOrderDcAccessCode.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeOrderDcAccessCode.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeOrderDcAccessCode.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/databoxedge/examples/Get-AzDataBoxEdgeRole.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeRole.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeRole.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/databoxedge/examples/Get-AzDataBoxEdgeShare.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeShare.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeShare.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/databoxedge/examples/Get-AzDataBoxEdgeStorageAccount.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeStorageAccount.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeStorageAccount.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/databoxedge/examples/Get-AzDataBoxEdgeStorageAccountCredentials.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeStorageAccountCredentials.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeStorageAccountCredentials.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/databoxedge/examples/Get-AzDataBoxEdgeTrigger.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeTrigger.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeTrigger.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/databoxedge/examples/Get-AzDataBoxEdgeUser.md b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeUser.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Get-AzDataBoxEdgeUser.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/databoxedge/examples/Install-AzDataBoxEdgeDeviceUpdate.md b/swaggerci/databoxedge/examples/Install-AzDataBoxEdgeDeviceUpdate.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Install-AzDataBoxEdgeDeviceUpdate.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/databoxedge/examples/Invoke-AzDataBoxEdgeDownloadDeviceUpdate.md b/swaggerci/databoxedge/examples/Invoke-AzDataBoxEdgeDownloadDeviceUpdate.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Invoke-AzDataBoxEdgeDownloadDeviceUpdate.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/databoxedge/examples/Invoke-AzDataBoxEdgeScanDevice.md b/swaggerci/databoxedge/examples/Invoke-AzDataBoxEdgeScanDevice.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Invoke-AzDataBoxEdgeScanDevice.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/databoxedge/examples/Invoke-AzDataBoxEdgeUploadDeviceCertificate.md b/swaggerci/databoxedge/examples/Invoke-AzDataBoxEdgeUploadDeviceCertificate.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Invoke-AzDataBoxEdgeUploadDeviceCertificate.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/databoxedge/examples/New-AzDataBoxEdgeAddon.md b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeAddon.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeAddon.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/databoxedge/examples/New-AzDataBoxEdgeBandwidthSchedule.md b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeBandwidthSchedule.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeBandwidthSchedule.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/databoxedge/examples/New-AzDataBoxEdgeContainer.md b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeContainer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeContainer.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/databoxedge/examples/New-AzDataBoxEdgeDevice.md b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeDevice.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeDevice.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/databoxedge/examples/New-AzDataBoxEdgeDeviceCertificate.md b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeDeviceCertificate.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeDeviceCertificate.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/databoxedge/examples/New-AzDataBoxEdgeDeviceSecuritySetting.md b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeDeviceSecuritySetting.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeDeviceSecuritySetting.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/databoxedge/examples/New-AzDataBoxEdgeMonitoringConfig.md b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeMonitoringConfig.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeMonitoringConfig.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/databoxedge/examples/New-AzDataBoxEdgeOrder.md b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeOrder.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeOrder.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/databoxedge/examples/New-AzDataBoxEdgeRole.md b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeRole.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeRole.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/databoxedge/examples/New-AzDataBoxEdgeShare.md b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeShare.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeShare.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/databoxedge/examples/New-AzDataBoxEdgeStorageAccount.md b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeStorageAccount.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeStorageAccount.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/databoxedge/examples/New-AzDataBoxEdgeStorageAccountCredentials.md b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeStorageAccountCredentials.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeStorageAccountCredentials.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/databoxedge/examples/New-AzDataBoxEdgeTrigger.md b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeTrigger.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeTrigger.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/databoxedge/examples/New-AzDataBoxEdgeUser.md b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeUser.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/New-AzDataBoxEdgeUser.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/databoxedge/examples/Remove-AzDataBoxEdgeAddon.md b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeAddon.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeAddon.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/databoxedge/examples/Remove-AzDataBoxEdgeBandwidthSchedule.md b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeBandwidthSchedule.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeBandwidthSchedule.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/databoxedge/examples/Remove-AzDataBoxEdgeContainer.md b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeContainer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeContainer.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/databoxedge/examples/Remove-AzDataBoxEdgeDevice.md b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeDevice.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeDevice.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/databoxedge/examples/Remove-AzDataBoxEdgeMonitoringConfig.md b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeMonitoringConfig.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeMonitoringConfig.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/databoxedge/examples/Remove-AzDataBoxEdgeOrder.md b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeOrder.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeOrder.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/databoxedge/examples/Remove-AzDataBoxEdgeRole.md b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeRole.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeRole.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/databoxedge/examples/Remove-AzDataBoxEdgeShare.md b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeShare.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeShare.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/databoxedge/examples/Remove-AzDataBoxEdgeStorageAccount.md b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeStorageAccount.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeStorageAccount.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/databoxedge/examples/Remove-AzDataBoxEdgeStorageAccountCredentials.md b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeStorageAccountCredentials.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeStorageAccountCredentials.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/databoxedge/examples/Remove-AzDataBoxEdgeTrigger.md b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeTrigger.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeTrigger.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/databoxedge/examples/Remove-AzDataBoxEdgeUser.md b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeUser.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Remove-AzDataBoxEdgeUser.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/databoxedge/examples/Start-AzDataBoxEdgeSupportPackage.md b/swaggerci/databoxedge/examples/Start-AzDataBoxEdgeSupportPackage.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Start-AzDataBoxEdgeSupportPackage.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/databoxedge/examples/Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility.md b/swaggerci/databoxedge/examples/Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility.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/databoxedge/examples/Update-AzDataBoxEdgeContainer.md b/swaggerci/databoxedge/examples/Update-AzDataBoxEdgeContainer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Update-AzDataBoxEdgeContainer.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/databoxedge/examples/Update-AzDataBoxEdgeDevice.md b/swaggerci/databoxedge/examples/Update-AzDataBoxEdgeDevice.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Update-AzDataBoxEdgeDevice.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/databoxedge/examples/Update-AzDataBoxEdgeDeviceExtendedInformation.md b/swaggerci/databoxedge/examples/Update-AzDataBoxEdgeDeviceExtendedInformation.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Update-AzDataBoxEdgeDeviceExtendedInformation.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/databoxedge/examples/Update-AzDataBoxEdgeDeviceSecuritySetting.md b/swaggerci/databoxedge/examples/Update-AzDataBoxEdgeDeviceSecuritySetting.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Update-AzDataBoxEdgeDeviceSecuritySetting.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/databoxedge/examples/Update-AzDataBoxEdgeShare.md b/swaggerci/databoxedge/examples/Update-AzDataBoxEdgeShare.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/databoxedge/examples/Update-AzDataBoxEdgeShare.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/databoxedge/export-surface.ps1 b/swaggerci/databoxedge/export-surface.ps1 new file mode 100644 index 000000000000..df33a869ce0d --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.private.dll' +if(-not (Test-Path $dll)) { + Write-Error "Unable to find output assembly in '$binFolder'." +} +$null = Import-Module -Name $dll + +$moduleName = 'Az.DataBoxEdge' +$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/databoxedge/exports/Get-AzDataBoxEdgeAddon.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeAddon.ps1 new file mode 100644 index 000000000000..72b4b3c10c86 --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeAddon.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets a specific addon by name. +.Description +Gets a specific addon by name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeaddon +#> +function Get-AzDataBoxEdgeAddon { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('AddonName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The addon name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The role name. + ${RoleName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeAddon_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeAddon_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeAddon_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeAlert.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeAlert.ps1 new file mode 100644 index 000000000000..f7e3c817213c --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeAlert.ps1 @@ -0,0 +1,205 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 an alert by name. +.Description +Gets an alert by name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgealert +#> +function Get-AzDataBoxEdgeAlert { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The alert name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeAlert_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeAlert_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeAlert_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeAvailableSku.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeAvailableSku.ps1 new file mode 100644 index 000000000000..84a20aac5e11 --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeAvailableSku.ps1 @@ -0,0 +1,158 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 all the available Skus and information related to them. +.Description +List all the available Skus and information related to them. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeavailablesku +#> +function Get-AzDataBoxEdgeAvailableSku { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeAvailableSku_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeBandwidthSchedule.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeBandwidthSchedule.ps1 new file mode 100644 index 000000000000..55ae12b03c03 --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeBandwidthSchedule.ps1 @@ -0,0 +1,205 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 properties of the specified bandwidth schedule. +.Description +Gets the properties of the specified bandwidth schedule. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgebandwidthschedule +#> +function Get-AzDataBoxEdgeBandwidthSchedule { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The bandwidth schedule name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeBandwidthSchedule_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeBandwidthSchedule_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeBandwidthSchedule_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeContainer.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeContainer.ps1 new file mode 100644 index 000000000000..ab492ce4a7b2 --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeContainer.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets a container by name. +.Description +Gets a container by name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgecontainer +#> +function Get-AzDataBoxEdgeContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ContainerName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The container Name + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The Storage Account Name + ${StorageAccountName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeContainer_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeContainer_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeContainer_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeDevice.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeDevice.ps1 new file mode 100644 index 000000000000..ec82a04ce533 --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeDevice.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the properties of the Data Box Edge/Data Box Gateway device. +.Description +Gets the properties of the Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgedevice +#> +function Get-AzDataBoxEdgeDevice { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('DeviceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Query')] + [System.String] + # Specify $expand=details to populate additional fields related to the resource or Specify $skipToken= to populate the next page in the list. + ${Expand}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeDevice_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeDevice_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeDevice_List'; + List1 = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeDevice_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo.ps1 new file mode 100644 index 000000000000..b9152f673c91 --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo.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 +Gets the properties of the specified device capacity info. +.Description +Gets the properties of the specified device capacity info. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfo +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgedevicecapacityinfodevicecapacityinfo +#> +function Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfo])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeDeviceExtendedInformation.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeDeviceExtendedInformation.ps1 new file mode 100644 index 000000000000..e17b1cba8192 --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeDeviceExtendedInformation.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 +Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. +.Description +Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgedeviceextendedinformation +#> +function Get-AzDataBoxEdgeDeviceExtendedInformation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeDeviceExtendedInformation_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeDeviceExtendedInformation_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeDeviceNetworkSetting.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeDeviceNetworkSetting.ps1 new file mode 100644 index 000000000000..cb482bdff52b --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeDeviceNetworkSetting.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 +Gets the network settings of the specified Data Box Edge/Data Box Gateway device. +.Description +Gets the network settings of the specified Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgedevicenetworksetting +#> +function Get-AzDataBoxEdgeDeviceNetworkSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettings])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeDeviceNetworkSetting_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeDeviceNetworkSetting_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeDeviceUpdateSummary.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeDeviceUpdateSummary.ps1 new file mode 100644 index 000000000000..0b66dc1c5664 --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeDeviceUpdateSummary.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 +Gets information about the availability of updates based on the last scan of the device. +It also gets information about any ongoing download or install jobs on the device. +.Description +Gets information about the availability of updates based on the last scan of the device. +It also gets information about any ongoing download or install jobs on the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummary +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgedeviceupdatesummary +#> +function Get-AzDataBoxEdgeDeviceUpdateSummary { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummary])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeDeviceUpdateSummary_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeDeviceUpdateSummary_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting.ps1 new file mode 100644 index 000000000000..294a56ae8540 --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting.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 +Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. +.Description +Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgediagnosticsettingdiagnosticproactivelogcollectionsetting +#> +function Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting.ps1 new file mode 100644 index 000000000000..5bfc714642c2 --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting.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 +Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. +.Description +Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgediagnosticsettingdiagnosticremotesupportsetting +#> +function Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeJob.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeJob.ps1 new file mode 100644 index 000000000000..b194420030c8 --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeJob.ps1 @@ -0,0 +1,201 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 details of a specified job on a Data Box Edge/Data Box Gateway device. +.Description +Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgejob +#> +function Get-AzDataBoxEdgeJob { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJob])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The job name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeJob_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeJob_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeMonitoringConfig.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeMonitoringConfig.ps1 new file mode 100644 index 000000000000..17bae80c7f5f --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeMonitoringConfig.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 +Gets a metric configuration of a role. +.Description +Gets a metric configuration of a role. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgemonitoringconfig +#> +function Get-AzDataBoxEdgeMonitoringConfig { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The role name. + ${RoleName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeMonitoringConfig_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeMonitoringConfig_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeMonitoringConfig_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeNode.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeNode.ps1 new file mode 100644 index 000000000000..8536424e2c8b --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeNode.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 +Gets all the nodes currently configured under this Data Box Edge device +.Description +Gets all the nodes currently configured under this Data Box Edge device +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INode +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgenode +#> +function Get-AzDataBoxEdgeNode { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INode])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeNode_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeOperationsStatus.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeOperationsStatus.ps1 new file mode 100644 index 000000000000..2f8d038af9da --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeOperationsStatus.ps1 @@ -0,0 +1,201 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 details of a specified job on a Data Box Edge/Data Box Gateway device. +.Description +Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeoperationsstatus +#> +function Get-AzDataBoxEdgeOperationsStatus { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJob])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The job name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeOperationsStatus_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeOperationsStatus_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeOrder.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeOrder.ps1 new file mode 100644 index 000000000000..55057dd079f1 --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeOrder.ps1 @@ -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. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets a specific order by name. +.Description +Gets a specific order by name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeorder +#> +function Get-AzDataBoxEdgeOrder { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeOrder_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeOrder_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeOrder_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeOrderDcAccessCode.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeOrderDcAccessCode.ps1 new file mode 100644 index 000000000000..41c4b7e9385b --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeOrderDcAccessCode.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 +Gets the DCAccess Code +.Description +Gets the DCAccess Code +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeorderdcaccesscode +#> +function Get-AzDataBoxEdgeOrderDcAccessCode { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeOrderDcAccessCode_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeRole.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeRole.ps1 new file mode 100644 index 000000000000..bdb37b72b444 --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeRole.ps1 @@ -0,0 +1,205 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 a specific role by name. +.Description +Gets a specific role by name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgerole +#> +function Get-AzDataBoxEdgeRole { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The role name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeRole_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeRole_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeRole_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeShare.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeShare.ps1 new file mode 100644 index 000000000000..b10677d873ce --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeShare.ps1 @@ -0,0 +1,205 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 a share by name. +.Description +Gets a share by name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeshare +#> +function Get-AzDataBoxEdgeShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The share name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeShare_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeShare_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeShare_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeStorageAccount.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeStorageAccount.ps1 new file mode 100644 index 000000000000..499dd6a18987 --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeStorageAccount.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 +Gets a StorageAccount by name. +.Description +Gets a StorageAccount by name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgestorageaccount +#> +function Get-AzDataBoxEdgeStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('StorageAccountName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The storage account name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeStorageAccount_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeStorageAccount_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeStorageAccount_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeStorageAccountCredentials.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeStorageAccountCredentials.ps1 new file mode 100644 index 000000000000..95734f4485a8 --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeStorageAccountCredentials.ps1 @@ -0,0 +1,205 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 properties of the specified storage account credential. +.Description +Gets the properties of the specified storage account credential. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgestorageaccountcredentials +#> +function Get-AzDataBoxEdgeStorageAccountCredentials { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The storage account credential name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeStorageAccountCredentials_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeStorageAccountCredentials_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeStorageAccountCredentials_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeTrigger.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeTrigger.ps1 new file mode 100644 index 000000000000..d2d0d3cbda82 --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeTrigger.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 +Get a specific trigger by name. +.Description +Get a specific trigger by name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgetrigger +#> +function Get-AzDataBoxEdgeTrigger { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The trigger name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Query')] + [System.String] + # Specify $filter='CustomContextTag eq ' to filter on custom context tag property + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeTrigger_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeTrigger_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeTrigger_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Get-AzDataBoxEdgeUser.ps1 b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeUser.ps1 new file mode 100644 index 000000000000..11dfeb41fce1 --- /dev/null +++ b/swaggerci/databoxedge/exports/Get-AzDataBoxEdgeUser.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 +Gets the properties of the specified user. +.Description +Gets the properties of the specified user. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeuser +#> +function Get-AzDataBoxEdgeUser { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The user name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Query')] + [System.String] + # Specify $filter='Type eq ' to filter on user type property + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeUser_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeUser_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeUser_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Install-AzDataBoxEdgeDeviceUpdate.ps1 b/swaggerci/databoxedge/exports/Install-AzDataBoxEdgeDeviceUpdate.ps1 new file mode 100644 index 000000000000..4bae9b382dd9 --- /dev/null +++ b/swaggerci/databoxedge/exports/Install-AzDataBoxEdgeDeviceUpdate.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Installs the updates on the Data Box Edge/Data Box Gateway device. +.Description +Installs the updates on the Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/install-azdataboxedgedeviceupdate +#> +function Install-AzDataBoxEdgeDeviceUpdate { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Install', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Install', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Install', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Install')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='InstallViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Install-AzDataBoxEdgeDeviceUpdate_Install'; + InstallViaIdentity = 'Az.DataBoxEdge.private\Install-AzDataBoxEdgeDeviceUpdate_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Invoke-AzDataBoxEdgeDownloadDeviceUpdate.ps1 b/swaggerci/databoxedge/exports/Invoke-AzDataBoxEdgeDownloadDeviceUpdate.ps1 new file mode 100644 index 000000000000..5e7f66384787 --- /dev/null +++ b/swaggerci/databoxedge/exports/Invoke-AzDataBoxEdgeDownloadDeviceUpdate.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Downloads the updates on a Data Box Edge/Data Box Gateway device. +.Description +Downloads the updates on a Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/invoke-azdataboxedgedownloaddeviceupdate +#> +function Invoke-AzDataBoxEdgeDownloadDeviceUpdate { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Download', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Download', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Download', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Download')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DownloadViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Invoke-AzDataBoxEdgeDownloadDeviceUpdate_Download'; + DownloadViaIdentity = 'Az.DataBoxEdge.private\Invoke-AzDataBoxEdgeDownloadDeviceUpdate_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Invoke-AzDataBoxEdgeScanDevice.ps1 b/swaggerci/databoxedge/exports/Invoke-AzDataBoxEdgeScanDevice.ps1 new file mode 100644 index 000000000000..71ba11d71013 --- /dev/null +++ b/swaggerci/databoxedge/exports/Invoke-AzDataBoxEdgeScanDevice.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Scans for updates on a Data Box Edge/Data Box Gateway device. +.Description +Scans for updates on a Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/invoke-azdataboxedgescandevice +#> +function Invoke-AzDataBoxEdgeScanDevice { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Scan', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Scan', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Scan', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Scan')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ScanViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Invoke-AzDataBoxEdgeScanDevice_Scan'; + ScanViaIdentity = 'Az.DataBoxEdge.private\Invoke-AzDataBoxEdgeScanDevice_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Invoke-AzDataBoxEdgeUploadDeviceCertificate.ps1 b/swaggerci/databoxedge/exports/Invoke-AzDataBoxEdgeUploadDeviceCertificate.ps1 new file mode 100644 index 000000000000..9d3312dc9656 --- /dev/null +++ b/swaggerci/databoxedge/exports/Invoke-AzDataBoxEdgeUploadDeviceCertificate.ps1 @@ -0,0 +1,230 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +Uploads registration certificate for the device. +.Description +Uploads registration certificate for the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. + +PARAMETER : The upload certificate request. + Certificate : The base64 encoded certificate raw data. + [AuthenticationType ]: The authentication type. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/invoke-azdataboxedgeuploaddevicecertificate +#> +function Invoke-AzDataBoxEdgeUploadDeviceCertificate { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponse])] +[CmdletBinding(DefaultParameterSetName='UploadExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Upload', Mandatory)] + [Parameter(ParameterSetName='UploadExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Upload', Mandatory)] + [Parameter(ParameterSetName='UploadExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Upload')] + [Parameter(ParameterSetName='UploadExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest] + # The upload certificate request. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='UploadExpanded', Mandatory)] + [Parameter(ParameterSetName='UploadViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The base64 encoded certificate raw data. + ${Certificate}, + + [Parameter(ParameterSetName='UploadExpanded')] + [Parameter(ParameterSetName='UploadViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType] + # The authentication type. + ${AuthenticationType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Invoke-AzDataBoxEdgeUploadDeviceCertificate_Upload'; + UploadExpanded = 'Az.DataBoxEdge.private\Invoke-AzDataBoxEdgeUploadDeviceCertificate_UploadExpanded'; + UploadViaIdentity = 'Az.DataBoxEdge.private\Invoke-AzDataBoxEdgeUploadDeviceCertificate_UploadViaIdentity'; + UploadViaIdentityExpanded = 'Az.DataBoxEdge.private\Invoke-AzDataBoxEdgeUploadDeviceCertificate_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/New-AzDataBoxEdgeAddon.ps1 b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeAddon.ps1 new file mode 100644 index 000000000000..45cf528fed37 --- /dev/null +++ b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeAddon.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create or update a addon. +.Description +Create or update a addon. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgeaddon +#> +function New-AzDataBoxEdgeAddon { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Alias('AddonName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The addon name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The role name. + ${RoleName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType] + # Addon type. + ${Kind}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeAddon_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/New-AzDataBoxEdgeBandwidthSchedule.ps1 b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeBandwidthSchedule.ps1 new file mode 100644 index 000000000000..80dc94702acf --- /dev/null +++ b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeBandwidthSchedule.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 a bandwidth schedule. +.Description +Creates or updates a bandwidth schedule. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgebandwidthschedule +#> +function New-AzDataBoxEdgeBandwidthSchedule { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The bandwidth schedule name which needs to be added/updated. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [AllowEmptyCollection()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek[]] + # The days of the week when this schedule is applicable. + ${Day}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.Int32] + # The bandwidth rate in Mbps. + ${RateInMbps}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The start time of the schedule in UTC. + ${Start}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The stop time of the schedule in UTC. + ${Stop}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeBandwidthSchedule_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/New-AzDataBoxEdgeContainer.ps1 b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeContainer.ps1 new file mode 100644 index 000000000000..09f96830c100 --- /dev/null +++ b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeContainer.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates a new container or updates an existing container on the device. +.Description +Creates a new container or updates an existing container on the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgecontainer +#> +function New-AzDataBoxEdgeContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Alias('ContainerName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The container name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The Storage Account Name + ${StorageAccountName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat] + # DataFormat for Container + ${DataFormat}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeContainer_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/New-AzDataBoxEdgeDevice.ps1 b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeDevice.ps1 new file mode 100644 index 000000000000..1f783e755769 --- /dev/null +++ b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeDevice.ps1 @@ -0,0 +1,222 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 a Data Box Edge/Data Box Gateway resource. +.Description +Creates or updates a Data Box Edge/Data Box Gateway resource. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgedevice +#> +function New-AzDataBoxEdgeDevice { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('DeviceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The location of the device. + # This is a supported and registered Azure geographical region (for example, West US, East US, or Southeast Asia). + # The geographical region of a device cannot be changed once it is created, but if an identical geographical region is specified on update, the request will succeed. + ${Location}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType] + # DataResidencyType enum + ${DataResidencyType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The etag for the devices. + ${Etag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType] + # Identity type + ${IdentityType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName] + # SKU name. + ${SkuName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier] + # The SKU tier. + # This is based on the SKU name. + ${SkuTier}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags]))] + [System.Collections.Hashtable] + # The list of tags that describe the device. + # These tags can be used to view and group this device (across resource groups). + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeDevice_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/New-AzDataBoxEdgeDeviceCertificate.ps1 b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeDeviceCertificate.ps1 new file mode 100644 index 000000000000..8514ad335073 --- /dev/null +++ b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeDeviceCertificate.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 +Generates certificate for activation key. +.Description +Generates certificate for activation key. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponse +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgedevicecertificate +#> +function New-AzDataBoxEdgeDeviceCertificate { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponse])] +[CmdletBinding(DefaultParameterSetName='Generate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Generate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Generate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Generate')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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 = @{ + Generate = 'Az.DataBoxEdge.private\New-AzDataBoxEdgeDeviceCertificate_Generate'; + GenerateViaIdentity = 'Az.DataBoxEdge.private\New-AzDataBoxEdgeDeviceCertificate_GenerateViaIdentity'; + } + if (('Generate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/New-AzDataBoxEdgeDeviceSecuritySetting.ps1 b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeDeviceSecuritySetting.ps1 new file mode 100644 index 000000000000..99795abd2c5b --- /dev/null +++ b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeDeviceSecuritySetting.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Updates the security settings on a Data Box Edge/Data Box Gateway device. +.Description +Updates the security settings on a Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +System.Boolean +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgedevicesecuritysetting +#> +function New-AzDataBoxEdgeDeviceSecuritySetting { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm] + # The algorithm used to encrypt "Value". + ${DeviceAdminPasswordEncryptionAlgorithm}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The value of the secret. + ${DeviceAdminPasswordValue}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Thumbprint certificate used to encrypt \"Value\". + # If the value is unencrypted, it will be null. + ${DeviceAdminPasswordEncryptionCertThumbprint}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeDeviceSecuritySetting_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/New-AzDataBoxEdgeMonitoringConfig.ps1 b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeMonitoringConfig.ps1 new file mode 100644 index 000000000000..ae7a8ddba740 --- /dev/null +++ b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeMonitoringConfig.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates a new metric configuration or updates an existing one for a role. +.Description +Creates a new metric configuration or updates an existing one for a role. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration +.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. + +METRICCONFIGURATION : The metrics configuration details + CounterSet : Host name for the IoT hub associated to the device. + Counter : The counters that should be collected in this set. + Name : The counter name. + [AdditionalDimension ]: The additional dimensions to be added to metric. + SourceName : The dimension value. + SourceType : The dimension type. + [DimensionFilter ]: The dimension filter. + [Instance ]: The instance from which counter should be collected. + ResourceId : The Resource ID on which the metrics should be pushed. + [MdmAccount ]: The MDM account to which the counters should be pushed. + [MetricNameSpace ]: The MDM namespace to which the counters should be pushed. This is required if MDMAccount is specified +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgemonitoringconfig +#> +function New-AzDataBoxEdgeMonitoringConfig { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The role name. + ${RoleName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration[]] + # The metrics configuration details + # To construct, see NOTES section for METRICCONFIGURATION properties and create a hash table. + ${MetricConfiguration}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeMonitoringConfig_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/New-AzDataBoxEdgeOrder.ps1 b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeOrder.ps1 new file mode 100644 index 000000000000..c0e07ef0fe63 --- /dev/null +++ b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeOrder.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates an order. +.Description +Creates or updates an order. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgeorder +#> +function New-AzDataBoxEdgeOrder { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The order details of a device. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The name of the company. + ${ContactInformationCompanyName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The contact person name. + ${ContactInformationContactPerson}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String[]] + # The email list. + ${ContactInformationEmailList}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The phone number. + ${ContactInformationPhone}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType] + # ShipmentType of the order + ${ShipmentType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The city name. + ${ShippingAddressCity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The country name. + ${ShippingAddressCountry}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The address line1. + ${ShippingAddressLine1}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The address line2. + ${ShippingAddressLine2}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The address line3. + ${ShippingAddressLine3}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The postal code. + ${ShippingAddressPostalCode}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The state name. + ${ShippingAddressState}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeOrder_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/New-AzDataBoxEdgeRole.ps1 b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeRole.ps1 new file mode 100644 index 000000000000..981f698c98ee --- /dev/null +++ b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeRole.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 +Create or update a role. +.Description +Create or update a role. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgerole +#> +function New-AzDataBoxEdgeRole { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The role name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes] + # Role type. + ${Kind}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeRole_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/New-AzDataBoxEdgeShare.ps1 b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeShare.ps1 new file mode 100644 index 000000000000..90bf0d36f814 --- /dev/null +++ b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeShare.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates a new share or updates an existing share on the device. +.Description +Creates a new share or updates an existing share on the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare +.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. + +CLIENTACCESSRIGHTS : List of IP addresses and corresponding access rights on the share(required for NFS protocol). + AccessPermission : Type of access to be allowed for the client. + Client : IP of the client. + +USERACCESSRIGHTS : Mapping of users and corresponding access rights on the share (required for SMB protocol). + AccessType : Type of access to be allowed for the user. + UserId : User ID (already existing in the device). +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgeshare +#> +function New-AzDataBoxEdgeShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The share name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol] + # Access protocol to be used by the share. + ${AccessProtocol}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus] + # Current monitoring status of the share. + ${MonitoringStatus}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus] + # Current status of the share. + ${ShareStatus}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob). + ${AzureContainerInfoContainerName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat] + # Storage format used for the file represented by the share. + ${AzureContainerInfoDataFormat}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # ID of the storage account credential used to access storage. + ${AzureContainerInfoStorageAccountCredentialId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight[]] + # List of IP addresses and corresponding access rights on the share(required for NFS protocol). + # To construct, see NOTES section for CLIENTACCESSRIGHTS properties and create a hash table. + ${ClientAccessRights}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy] + # Data policy of the share. + ${DataPolicy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Description for the share. + ${Description}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. + # This could be a failed job or a successful job. + ${RefreshDetailErrorManifestFile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that job. + # The field is empty if no job is in progress. + ${RefreshDetailInProgressRefreshJobId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.DateTime] + # Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed job or a successful job. + ${RefreshDetailLastCompletedRefreshJobTimeInUtc}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Indicates the id of the last refresh job on this particular share or container,if any. + # This could be a failed job or a successful job. + ${RefreshDetailLastJob}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight[]] + # Mapping of users and corresponding access rights on the share (required for SMB protocol). + # To construct, see NOTES section for USERACCESSRIGHTS properties and create a hash table. + ${UserAccessRights}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeShare_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/New-AzDataBoxEdgeStorageAccount.ps1 b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeStorageAccount.ps1 new file mode 100644 index 000000000000..31c0ece693a6 --- /dev/null +++ b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeStorageAccount.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 +Creates a new StorageAccount or updates an existing StorageAccount on the device. +.Description +Creates a new StorageAccount or updates an existing StorageAccount on the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgestorageaccount +#> +function New-AzDataBoxEdgeStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Alias('StorageAccountName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The StorageAccount name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy] + # Data policy of the storage Account. + ${DataPolicy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Description for the storage Account. + ${Description}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Storage Account Credential Id + ${StorageAccountCredentialId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus] + # Current status of the storage account + ${StorageAccountStatus}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeStorageAccount_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/New-AzDataBoxEdgeStorageAccountCredentials.ps1 b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeStorageAccountCredentials.ps1 new file mode 100644 index 000000000000..d4367cd7bf73 --- /dev/null +++ b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeStorageAccountCredentials.ps1 @@ -0,0 +1,253 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.DataBoxEdge.Models.Api20220301.IStorageAccountCredential +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgestorageaccountcredentials +#> +function New-AzDataBoxEdgeStorageAccountCredentials { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The storage account credential name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType] + # Type of storage accessed on the storage account. + ${AccountType}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Alias for the storage account. + ${Alias}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus] + # Signifies whether SSL needs to be enabled or not. + ${SslStatus}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm] + # The algorithm used to encrypt "Value". + ${AccountKeyEncryptionAlgorithm}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Thumbprint certificate used to encrypt \"Value\". + # If the value is unencrypted, it will be null. + ${AccountKeyEncryptionCertThumbprint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The value of the secret. + ${AccountKeyValue}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Blob end point for private clouds. + ${BlobDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Connection string for the storage account. + # Use this string if username and account key are not specified. + ${ConnectionString}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Id of the storage account. + ${StorageAccountId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Username for the storage account. + ${UserName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeStorageAccountCredentials_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/New-AzDataBoxEdgeTrigger.ps1 b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeTrigger.ps1 new file mode 100644 index 000000000000..2f925e7cdfd7 --- /dev/null +++ b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeTrigger.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 a trigger. +.Description +Creates or updates a trigger. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgetrigger +#> +function New-AzDataBoxEdgeTrigger { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # Creates or updates a trigger + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The trigger name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType] + # Trigger Kind. + ${Kind}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeTrigger_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/New-AzDataBoxEdgeUser.ps1 b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeUser.ps1 new file mode 100644 index 000000000000..9a7a302f92ef --- /dev/null +++ b/swaggerci/databoxedge/exports/New-AzDataBoxEdgeUser.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 +Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. +.Description +Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgeuser +#> +function New-AzDataBoxEdgeUser { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The user name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType] + # Type of the user. + ${UserType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm] + # The algorithm used to encrypt "Value". + ${EncryptedPasswordEncryptionAlgorithm}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Thumbprint certificate used to encrypt \"Value\". + # If the value is unencrypted, it will be null. + ${EncryptedPasswordEncryptionCertThumbprint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The value of the secret. + ${EncryptedPasswordValue}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeUser_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/ProxyCmdletDefinitions.ps1 b/swaggerci/databoxedge/exports/ProxyCmdletDefinitions.ps1 new file mode 100644 index 000000000000..4e0bde697dcd --- /dev/null +++ b/swaggerci/databoxedge/exports/ProxyCmdletDefinitions.ps1 @@ -0,0 +1,12567 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 a specific addon by name. +.Description +Gets a specific addon by name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeaddon +#> +function Get-AzDataBoxEdgeAddon { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('AddonName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The addon name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The role name. + ${RoleName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeAddon_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeAddon_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeAddon_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.DataBoxEdge.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.DataBoxEdge.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 an alert by name. +.Description +Gets an alert by name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgealert +#> +function Get-AzDataBoxEdgeAlert { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The alert name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeAlert_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeAlert_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeAlert_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.DataBoxEdge.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.DataBoxEdge.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 all the available Skus and information related to them. +.Description +List all the available Skus and information related to them. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeavailablesku +#> +function Get-AzDataBoxEdgeAvailableSku { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeAvailableSku_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.DataBoxEdge.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.DataBoxEdge.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 properties of the specified bandwidth schedule. +.Description +Gets the properties of the specified bandwidth schedule. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgebandwidthschedule +#> +function Get-AzDataBoxEdgeBandwidthSchedule { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The bandwidth schedule name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeBandwidthSchedule_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeBandwidthSchedule_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeBandwidthSchedule_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.DataBoxEdge.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.DataBoxEdge.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 a container by name. +.Description +Gets a container by name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgecontainer +#> +function Get-AzDataBoxEdgeContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ContainerName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The container Name + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The Storage Account Name + ${StorageAccountName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeContainer_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeContainer_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeContainer_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.DataBoxEdge.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.DataBoxEdge.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 properties of the specified device capacity info. +.Description +Gets the properties of the specified device capacity info. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfo +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgedevicecapacityinfodevicecapacityinfo +#> +function Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfo])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo_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.DataBoxEdge.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.DataBoxEdge.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 additional information for the specified Azure Stack Edge/Data Box Gateway device. +.Description +Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgedeviceextendedinformation +#> +function Get-AzDataBoxEdgeDeviceExtendedInformation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeDeviceExtendedInformation_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeDeviceExtendedInformation_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.DataBoxEdge.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.DataBoxEdge.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 network settings of the specified Data Box Edge/Data Box Gateway device. +.Description +Gets the network settings of the specified Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgedevicenetworksetting +#> +function Get-AzDataBoxEdgeDeviceNetworkSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettings])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeDeviceNetworkSetting_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeDeviceNetworkSetting_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.DataBoxEdge.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.DataBoxEdge.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 information about the availability of updates based on the last scan of the device. +It also gets information about any ongoing download or install jobs on the device. +.Description +Gets information about the availability of updates based on the last scan of the device. +It also gets information about any ongoing download or install jobs on the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummary +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgedeviceupdatesummary +#> +function Get-AzDataBoxEdgeDeviceUpdateSummary { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummary])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeDeviceUpdateSummary_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeDeviceUpdateSummary_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.DataBoxEdge.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.DataBoxEdge.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 properties of the Data Box Edge/Data Box Gateway device. +.Description +Gets the properties of the Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgedevice +#> +function Get-AzDataBoxEdgeDevice { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('DeviceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Query')] + [System.String] + # Specify $expand=details to populate additional fields related to the resource or Specify $skipToken= to populate the next page in the list. + ${Expand}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeDevice_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeDevice_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeDevice_List'; + List1 = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeDevice_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.DataBoxEdge.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.DataBoxEdge.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 proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. +.Description +Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgediagnosticsettingdiagnosticproactivelogcollectionsetting +#> +function Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting_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.DataBoxEdge.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.DataBoxEdge.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 diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. +.Description +Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgediagnosticsettingdiagnosticremotesupportsetting +#> +function Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting_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.DataBoxEdge.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.DataBoxEdge.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 details of a specified job on a Data Box Edge/Data Box Gateway device. +.Description +Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgejob +#> +function Get-AzDataBoxEdgeJob { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJob])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The job name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeJob_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeJob_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.DataBoxEdge.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.DataBoxEdge.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 a metric configuration of a role. +.Description +Gets a metric configuration of a role. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgemonitoringconfig +#> +function Get-AzDataBoxEdgeMonitoringConfig { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The role name. + ${RoleName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeMonitoringConfig_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeMonitoringConfig_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeMonitoringConfig_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.DataBoxEdge.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.DataBoxEdge.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 all the nodes currently configured under this Data Box Edge device +.Description +Gets all the nodes currently configured under this Data Box Edge device +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INode +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgenode +#> +function Get-AzDataBoxEdgeNode { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INode])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeNode_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.DataBoxEdge.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.DataBoxEdge.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 details of a specified job on a Data Box Edge/Data Box Gateway device. +.Description +Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeoperationsstatus +#> +function Get-AzDataBoxEdgeOperationsStatus { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJob])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The job name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeOperationsStatus_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeOperationsStatus_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.DataBoxEdge.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.DataBoxEdge.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 DCAccess Code +.Description +Gets the DCAccess Code +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeorderdcaccesscode +#> +function Get-AzDataBoxEdgeOrderDcAccessCode { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeOrderDcAccessCode_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.DataBoxEdge.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.DataBoxEdge.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 a specific order by name. +.Description +Gets a specific order by name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeorder +#> +function Get-AzDataBoxEdgeOrder { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeOrder_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeOrder_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeOrder_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.DataBoxEdge.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.DataBoxEdge.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 a specific role by name. +.Description +Gets a specific role by name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgerole +#> +function Get-AzDataBoxEdgeRole { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The role name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeRole_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeRole_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeRole_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.DataBoxEdge.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.DataBoxEdge.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 a share by name. +.Description +Gets a share by name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeshare +#> +function Get-AzDataBoxEdgeShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The share name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeShare_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeShare_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeShare_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.DataBoxEdge.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.DataBoxEdge.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 properties of the specified storage account credential. +.Description +Gets the properties of the specified storage account credential. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgestorageaccountcredentials +#> +function Get-AzDataBoxEdgeStorageAccountCredentials { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The storage account credential name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeStorageAccountCredentials_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeStorageAccountCredentials_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeStorageAccountCredentials_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.DataBoxEdge.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.DataBoxEdge.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 a StorageAccount by name. +.Description +Gets a StorageAccount by name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgestorageaccount +#> +function Get-AzDataBoxEdgeStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('StorageAccountName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The storage account name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeStorageAccount_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeStorageAccount_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeStorageAccount_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.DataBoxEdge.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.DataBoxEdge.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 +Get a specific trigger by name. +.Description +Get a specific trigger by name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgetrigger +#> +function Get-AzDataBoxEdgeTrigger { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The trigger name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Query')] + [System.String] + # Specify $filter='CustomContextTag eq ' to filter on custom context tag property + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeTrigger_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeTrigger_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeTrigger_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.DataBoxEdge.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.DataBoxEdge.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 properties of the specified user. +.Description +Gets the properties of the specified user. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeuser +#> +function Get-AzDataBoxEdgeUser { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The user name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Query')] + [System.String] + # Specify $filter='Type eq ' to filter on user type property + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Get-AzDataBoxEdgeUser_Get'; + GetViaIdentity = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeUser_GetViaIdentity'; + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeUser_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.DataBoxEdge.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.DataBoxEdge.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 Data Box Edge/Data Box Gateway device. +.Description +Installs the updates on the Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/install-azdataboxedgedeviceupdate +#> +function Install-AzDataBoxEdgeDeviceUpdate { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Install', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Install', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Install', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Install')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='InstallViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Install-AzDataBoxEdgeDeviceUpdate_Install'; + InstallViaIdentity = 'Az.DataBoxEdge.private\Install-AzDataBoxEdgeDeviceUpdate_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.DataBoxEdge.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.DataBoxEdge.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 the updates on a Data Box Edge/Data Box Gateway device. +.Description +Downloads the updates on a Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/invoke-azdataboxedgedownloaddeviceupdate +#> +function Invoke-AzDataBoxEdgeDownloadDeviceUpdate { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Download', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Download', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Download', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Download')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DownloadViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Invoke-AzDataBoxEdgeDownloadDeviceUpdate_Download'; + DownloadViaIdentity = 'Az.DataBoxEdge.private\Invoke-AzDataBoxEdgeDownloadDeviceUpdate_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.DataBoxEdge.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.DataBoxEdge.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 a Data Box Edge/Data Box Gateway device. +.Description +Scans for updates on a Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/invoke-azdataboxedgescandevice +#> +function Invoke-AzDataBoxEdgeScanDevice { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Scan', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Scan', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Scan', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Scan')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ScanViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Invoke-AzDataBoxEdgeScanDevice_Scan'; + ScanViaIdentity = 'Az.DataBoxEdge.private\Invoke-AzDataBoxEdgeScanDevice_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.DataBoxEdge.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.DataBoxEdge.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 +Uploads registration certificate for the device. +.Description +Uploads registration certificate for the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. + +PARAMETER : The upload certificate request. + Certificate : The base64 encoded certificate raw data. + [AuthenticationType ]: The authentication type. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/invoke-azdataboxedgeuploaddevicecertificate +#> +function Invoke-AzDataBoxEdgeUploadDeviceCertificate { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponse])] +[CmdletBinding(DefaultParameterSetName='UploadExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Upload', Mandatory)] + [Parameter(ParameterSetName='UploadExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Upload', Mandatory)] + [Parameter(ParameterSetName='UploadExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Upload')] + [Parameter(ParameterSetName='UploadExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest] + # The upload certificate request. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='UploadExpanded', Mandatory)] + [Parameter(ParameterSetName='UploadViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The base64 encoded certificate raw data. + ${Certificate}, + + [Parameter(ParameterSetName='UploadExpanded')] + [Parameter(ParameterSetName='UploadViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType] + # The authentication type. + ${AuthenticationType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Invoke-AzDataBoxEdgeUploadDeviceCertificate_Upload'; + UploadExpanded = 'Az.DataBoxEdge.private\Invoke-AzDataBoxEdgeUploadDeviceCertificate_UploadExpanded'; + UploadViaIdentity = 'Az.DataBoxEdge.private\Invoke-AzDataBoxEdgeUploadDeviceCertificate_UploadViaIdentity'; + UploadViaIdentityExpanded = 'Az.DataBoxEdge.private\Invoke-AzDataBoxEdgeUploadDeviceCertificate_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.DataBoxEdge.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.DataBoxEdge.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 +Create or update a addon. +.Description +Create or update a addon. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgeaddon +#> +function New-AzDataBoxEdgeAddon { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Alias('AddonName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The addon name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The role name. + ${RoleName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType] + # Addon type. + ${Kind}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeAddon_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.DataBoxEdge.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.DataBoxEdge.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 a bandwidth schedule. +.Description +Creates or updates a bandwidth schedule. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgebandwidthschedule +#> +function New-AzDataBoxEdgeBandwidthSchedule { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The bandwidth schedule name which needs to be added/updated. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [AllowEmptyCollection()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek[]] + # The days of the week when this schedule is applicable. + ${Day}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.Int32] + # The bandwidth rate in Mbps. + ${RateInMbps}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The start time of the schedule in UTC. + ${Start}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The stop time of the schedule in UTC. + ${Stop}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeBandwidthSchedule_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.DataBoxEdge.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.DataBoxEdge.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 a new container or updates an existing container on the device. +.Description +Creates a new container or updates an existing container on the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgecontainer +#> +function New-AzDataBoxEdgeContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Alias('ContainerName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The container name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The Storage Account Name + ${StorageAccountName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat] + # DataFormat for Container + ${DataFormat}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeContainer_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.DataBoxEdge.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.DataBoxEdge.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 +Generates certificate for activation key. +.Description +Generates certificate for activation key. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponse +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgedevicecertificate +#> +function New-AzDataBoxEdgeDeviceCertificate { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponse])] +[CmdletBinding(DefaultParameterSetName='Generate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Generate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Generate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Generate')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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 = @{ + Generate = 'Az.DataBoxEdge.private\New-AzDataBoxEdgeDeviceCertificate_Generate'; + GenerateViaIdentity = 'Az.DataBoxEdge.private\New-AzDataBoxEdgeDeviceCertificate_GenerateViaIdentity'; + } + if (('Generate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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 security settings on a Data Box Edge/Data Box Gateway device. +.Description +Updates the security settings on a Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +System.Boolean +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgedevicesecuritysetting +#> +function New-AzDataBoxEdgeDeviceSecuritySetting { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm] + # The algorithm used to encrypt "Value". + ${DeviceAdminPasswordEncryptionAlgorithm}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The value of the secret. + ${DeviceAdminPasswordValue}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Thumbprint certificate used to encrypt \"Value\". + # If the value is unencrypted, it will be null. + ${DeviceAdminPasswordEncryptionCertThumbprint}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeDeviceSecuritySetting_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.DataBoxEdge.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.DataBoxEdge.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 a Data Box Edge/Data Box Gateway resource. +.Description +Creates or updates a Data Box Edge/Data Box Gateway resource. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgedevice +#> +function New-AzDataBoxEdgeDevice { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('DeviceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The location of the device. + # This is a supported and registered Azure geographical region (for example, West US, East US, or Southeast Asia). + # The geographical region of a device cannot be changed once it is created, but if an identical geographical region is specified on update, the request will succeed. + ${Location}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType] + # DataResidencyType enum + ${DataResidencyType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The etag for the devices. + ${Etag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType] + # Identity type + ${IdentityType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName] + # SKU name. + ${SkuName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier] + # The SKU tier. + # This is based on the SKU name. + ${SkuTier}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags]))] + [System.Collections.Hashtable] + # The list of tags that describe the device. + # These tags can be used to view and group this device (across resource groups). + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeDevice_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.DataBoxEdge.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.DataBoxEdge.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 a new metric configuration or updates an existing one for a role. +.Description +Creates a new metric configuration or updates an existing one for a role. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration +.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. + +METRICCONFIGURATION : The metrics configuration details + CounterSet : Host name for the IoT hub associated to the device. + Counter : The counters that should be collected in this set. + Name : The counter name. + [AdditionalDimension ]: The additional dimensions to be added to metric. + SourceName : The dimension value. + SourceType : The dimension type. + [DimensionFilter ]: The dimension filter. + [Instance ]: The instance from which counter should be collected. + ResourceId : The Resource ID on which the metrics should be pushed. + [MdmAccount ]: The MDM account to which the counters should be pushed. + [MetricNameSpace ]: The MDM namespace to which the counters should be pushed. This is required if MDMAccount is specified +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgemonitoringconfig +#> +function New-AzDataBoxEdgeMonitoringConfig { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The role name. + ${RoleName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration[]] + # The metrics configuration details + # To construct, see NOTES section for METRICCONFIGURATION properties and create a hash table. + ${MetricConfiguration}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeMonitoringConfig_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.DataBoxEdge.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.DataBoxEdge.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 order. +.Description +Creates or updates an order. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgeorder +#> +function New-AzDataBoxEdgeOrder { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The order details of a device. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The name of the company. + ${ContactInformationCompanyName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The contact person name. + ${ContactInformationContactPerson}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String[]] + # The email list. + ${ContactInformationEmailList}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The phone number. + ${ContactInformationPhone}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType] + # ShipmentType of the order + ${ShipmentType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The city name. + ${ShippingAddressCity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The country name. + ${ShippingAddressCountry}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The address line1. + ${ShippingAddressLine1}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The address line2. + ${ShippingAddressLine2}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The address line3. + ${ShippingAddressLine3}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The postal code. + ${ShippingAddressPostalCode}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The state name. + ${ShippingAddressState}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeOrder_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.DataBoxEdge.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.DataBoxEdge.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 +Create or update a role. +.Description +Create or update a role. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgerole +#> +function New-AzDataBoxEdgeRole { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The role name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes] + # Role type. + ${Kind}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeRole_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.DataBoxEdge.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.DataBoxEdge.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 a new share or updates an existing share on the device. +.Description +Creates a new share or updates an existing share on the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare +.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. + +CLIENTACCESSRIGHTS : List of IP addresses and corresponding access rights on the share(required for NFS protocol). + AccessPermission : Type of access to be allowed for the client. + Client : IP of the client. + +USERACCESSRIGHTS : Mapping of users and corresponding access rights on the share (required for SMB protocol). + AccessType : Type of access to be allowed for the user. + UserId : User ID (already existing in the device). +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgeshare +#> +function New-AzDataBoxEdgeShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The share name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol] + # Access protocol to be used by the share. + ${AccessProtocol}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus] + # Current monitoring status of the share. + ${MonitoringStatus}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus] + # Current status of the share. + ${ShareStatus}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob). + ${AzureContainerInfoContainerName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat] + # Storage format used for the file represented by the share. + ${AzureContainerInfoDataFormat}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # ID of the storage account credential used to access storage. + ${AzureContainerInfoStorageAccountCredentialId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight[]] + # List of IP addresses and corresponding access rights on the share(required for NFS protocol). + # To construct, see NOTES section for CLIENTACCESSRIGHTS properties and create a hash table. + ${ClientAccessRights}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy] + # Data policy of the share. + ${DataPolicy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Description for the share. + ${Description}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. + # This could be a failed job or a successful job. + ${RefreshDetailErrorManifestFile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that job. + # The field is empty if no job is in progress. + ${RefreshDetailInProgressRefreshJobId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.DateTime] + # Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed job or a successful job. + ${RefreshDetailLastCompletedRefreshJobTimeInUtc}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Indicates the id of the last refresh job on this particular share or container,if any. + # This could be a failed job or a successful job. + ${RefreshDetailLastJob}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight[]] + # Mapping of users and corresponding access rights on the share (required for SMB protocol). + # To construct, see NOTES section for USERACCESSRIGHTS properties and create a hash table. + ${UserAccessRights}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeShare_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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IStorageAccountCredential +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgestorageaccountcredentials +#> +function New-AzDataBoxEdgeStorageAccountCredentials { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The storage account credential name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType] + # Type of storage accessed on the storage account. + ${AccountType}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Alias for the storage account. + ${Alias}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus] + # Signifies whether SSL needs to be enabled or not. + ${SslStatus}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm] + # The algorithm used to encrypt "Value". + ${AccountKeyEncryptionAlgorithm}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Thumbprint certificate used to encrypt \"Value\". + # If the value is unencrypted, it will be null. + ${AccountKeyEncryptionCertThumbprint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The value of the secret. + ${AccountKeyValue}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Blob end point for private clouds. + ${BlobDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Connection string for the storage account. + # Use this string if username and account key are not specified. + ${ConnectionString}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Id of the storage account. + ${StorageAccountId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Username for the storage account. + ${UserName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeStorageAccountCredentials_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.DataBoxEdge.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.DataBoxEdge.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 a new StorageAccount or updates an existing StorageAccount on the device. +.Description +Creates a new StorageAccount or updates an existing StorageAccount on the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgestorageaccount +#> +function New-AzDataBoxEdgeStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Alias('StorageAccountName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The StorageAccount name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy] + # Data policy of the storage Account. + ${DataPolicy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Description for the storage Account. + ${Description}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Storage Account Credential Id + ${StorageAccountCredentialId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus] + # Current status of the storage account + ${StorageAccountStatus}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeStorageAccount_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.DataBoxEdge.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.DataBoxEdge.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 a trigger. +.Description +Creates or updates a trigger. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgetrigger +#> +function New-AzDataBoxEdgeTrigger { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # Creates or updates a trigger + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The trigger name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType] + # Trigger Kind. + ${Kind}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeTrigger_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.DataBoxEdge.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.DataBoxEdge.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 a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. +.Description +Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/new-azdataboxedgeuser +#> +function New-AzDataBoxEdgeUser { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The user name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType] + # Type of the user. + ${UserType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm] + # The algorithm used to encrypt "Value". + ${EncryptedPasswordEncryptionAlgorithm}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Thumbprint certificate used to encrypt \"Value\". + # If the value is unencrypted, it will be null. + ${EncryptedPasswordEncryptionCertThumbprint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The value of the secret. + ${EncryptedPasswordValue}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\New-AzDataBoxEdgeUser_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.DataBoxEdge.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.DataBoxEdge.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 addon on the device. +.Description +Deletes the addon on the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgeaddon +#> +function Remove-AzDataBoxEdgeAddon { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('AddonName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The addon name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The role name. + ${RoleName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeAddon_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeAddon_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.DataBoxEdge.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.DataBoxEdge.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 specified bandwidth schedule. +.Description +Deletes the specified bandwidth schedule. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgebandwidthschedule +#> +function Remove-AzDataBoxEdgeBandwidthSchedule { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The bandwidth schedule name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeBandwidthSchedule_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeBandwidthSchedule_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.DataBoxEdge.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.DataBoxEdge.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 container on the Data Box Edge/Data Box Gateway device. +.Description +Deletes the container on the Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgecontainer +#> +function Remove-AzDataBoxEdgeContainer { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ContainerName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The container name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The Storage Account Name + ${StorageAccountName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeContainer_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeContainer_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.DataBoxEdge.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.DataBoxEdge.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 Data Box Edge/Data Box Gateway device. +.Description +Deletes the Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgedevice +#> +function Remove-AzDataBoxEdgeDevice { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('DeviceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeDevice_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeDevice_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.DataBoxEdge.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.DataBoxEdge.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 a new metric configuration for a role. +.Description +deletes a new metric configuration for a role. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgemonitoringconfig +#> +function Remove-AzDataBoxEdgeMonitoringConfig { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The role name. + ${RoleName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeMonitoringConfig_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeMonitoringConfig_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.DataBoxEdge.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.DataBoxEdge.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 order related to the device. +.Description +Deletes the order related to the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgeorder +#> +function Remove-AzDataBoxEdgeOrder { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeOrder_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeOrder_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.DataBoxEdge.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.DataBoxEdge.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 role on the device. +.Description +Deletes the role on the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgerole +#> +function Remove-AzDataBoxEdgeRole { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The role name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeRole_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeRole_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.DataBoxEdge.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.DataBoxEdge.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 share on the Data Box Edge/Data Box Gateway device. +.Description +Deletes the share on the Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgeshare +#> +function Remove-AzDataBoxEdgeShare { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The share name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeShare_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeShare_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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgestorageaccountcredentials +#> +function Remove-AzDataBoxEdgeStorageAccountCredentials { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The storage account credential name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeStorageAccountCredentials_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeStorageAccountCredentials_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.DataBoxEdge.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.DataBoxEdge.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 StorageAccount on the Data Box Edge/Data Box Gateway device. +.Description +Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgestorageaccount +#> +function Remove-AzDataBoxEdgeStorageAccount { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('StorageAccountName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The StorageAccount name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeStorageAccount_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeStorageAccount_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.DataBoxEdge.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.DataBoxEdge.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 trigger on the gateway device. +.Description +Deletes the trigger on the gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgetrigger +#> +function Remove-AzDataBoxEdgeTrigger { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The trigger name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeTrigger_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeTrigger_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.DataBoxEdge.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.DataBoxEdge.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 user on a databox edge/gateway device. +.Description +Deletes the user on a databox edge/gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgeuser +#> +function Remove-AzDataBoxEdgeUser { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The user name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeUser_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeUser_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.DataBoxEdge.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.DataBoxEdge.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 +Triggers support package on the device +.Description +Triggers support package on the device +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. + +TRIGGERSUPPORTPACKAGEREQUEST : The request object for trigger support package. + [Include ]: Type of files, which need to be included in the logs This will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) or a comma separated list of log types that are required + [MaximumTimeStamp ]: Start of the timespan of the log collection + [MinimumTimeStamp ]: MinimumTimeStamp from where logs need to be collected +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/start-azdataboxedgesupportpackage +#> +function Start-AzDataBoxEdgeSupportPackage { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='TriggerExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Trigger', Mandatory)] + [Parameter(ParameterSetName='TriggerExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Trigger', Mandatory)] + [Parameter(ParameterSetName='TriggerExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Trigger')] + [Parameter(ParameterSetName='TriggerExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='TriggerViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='TriggerViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Trigger', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='TriggerViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest] + # The request object for trigger support package. + # To construct, see NOTES section for TRIGGERSUPPORTPACKAGEREQUEST properties and create a hash table. + ${TriggerSupportPackageRequest}, + + [Parameter(ParameterSetName='TriggerExpanded')] + [Parameter(ParameterSetName='TriggerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Type of files, which need to be included in the logsThis will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived)or a comma separated list of log types that are required + ${Include}, + + [Parameter(ParameterSetName='TriggerExpanded')] + [Parameter(ParameterSetName='TriggerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.DateTime] + # Start of the timespan of the log collection + ${MaximumTimeStamp}, + + [Parameter(ParameterSetName='TriggerExpanded')] + [Parameter(ParameterSetName='TriggerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.DateTime] + # MinimumTimeStamp from where logs need to be collected + ${MinimumTimeStamp}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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 = @{ + Trigger = 'Az.DataBoxEdge.private\Start-AzDataBoxEdgeSupportPackage_Trigger'; + TriggerExpanded = 'Az.DataBoxEdge.private\Start-AzDataBoxEdgeSupportPackage_TriggerExpanded'; + TriggerViaIdentity = 'Az.DataBoxEdge.private\Start-AzDataBoxEdgeSupportPackage_TriggerViaIdentity'; + TriggerViaIdentityExpanded = 'Az.DataBoxEdge.private\Start-AzDataBoxEdgeSupportPackage_TriggerViaIdentityExpanded'; + } + if (('Trigger', 'TriggerExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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 +Posts the device capacity request info to check feasibility. +.Description +Posts the device capacity request info to check feasibility. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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. + +DEVICECAPACITYREQUESTINFO : Object for Capturing DeviceCapacityRequestInfo + VMPlacementQuery : Array containing the sizes of the VMs for checking if its feasible to create them on the appliance. + [VMPlacementResult ]: Array of the VMs of the sizes in VmSizes can be provisioned on the appliance. + [IsFeasible ]: Boolean value indicating if the VM(s) in VmSize can be created. + [Message ]: Localized message to be displayed to the user to explain the check result. + [MessageCode ]: MessageCode indicating reason for success or failure. + [VMSize ]: List of VM sizes being checked. + +INPUTOBJECT : Identity Parameter + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. + +VMPLACEMENTRESULT : Array of the VMs of the sizes in VmSizes can be provisioned on the appliance. + [IsFeasible ]: Boolean value indicating if the VM(s) in VmSize can be created. + [Message ]: Localized message to be displayed to the user to explain the check result. + [MessageCode ]: MessageCode indicating reason for success or failure. + [VMSize ]: List of VM sizes being checked. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/test-azdataboxedgedevicecapacitycheckresourcecreationfeasibility +#> +function Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CheckExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Check', Mandatory)] + [Parameter(ParameterSetName='CheckExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Check', Mandatory)] + [Parameter(ParameterSetName='CheckExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Check')] + [Parameter(ParameterSetName='CheckExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CheckViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Query')] + [System.String] + # The capacity name. + ${CapacityName}, + + [Parameter(ParameterSetName='Check', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo] + # Object for Capturing DeviceCapacityRequestInfo + # To construct, see NOTES section for DEVICECAPACITYREQUESTINFO properties and create a hash table. + ${DeviceCapacityRequestInfo}, + + [Parameter(ParameterSetName='CheckExpanded', Mandatory)] + [Parameter(ParameterSetName='CheckViaIdentityExpanded', Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String[][]] + # Array containing the sizes of the VMs for checking if its feasible to create them on the appliance. + ${VMPlacementQuery}, + + [Parameter(ParameterSetName='CheckExpanded')] + [Parameter(ParameterSetName='CheckViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult[]] + # Array of the VMs of the sizes in VmSizes can be provisioned on the appliance. + # To construct, see NOTES section for VMPLACEMENTRESULT properties and create a hash table. + ${VMPlacementResult}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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 = @{ + Check = 'Az.DataBoxEdge.private\Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_Check'; + CheckExpanded = 'Az.DataBoxEdge.private\Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckExpanded'; + CheckViaIdentity = 'Az.DataBoxEdge.private\Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentity'; + CheckViaIdentityExpanded = 'Az.DataBoxEdge.private\Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentityExpanded'; + } + if (('Check', 'CheckExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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 +Refreshes the container metadata with the data from the cloud. +.Description +Refreshes the container metadata with the data from the cloud. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/update-azdataboxedgecontainer +#> +function Update-AzDataBoxEdgeContainer { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Refresh', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Refresh', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Refresh', Mandatory)] + [Alias('ContainerName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The container name. + ${Name}, + + [Parameter(ParameterSetName='Refresh', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Refresh', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The Storage Account Name + ${StorageAccountName}, + + [Parameter(ParameterSetName='Refresh')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RefreshViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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 = @{ + Refresh = 'Az.DataBoxEdge.private\Update-AzDataBoxEdgeContainer_Refresh'; + RefreshViaIdentity = 'Az.DataBoxEdge.private\Update-AzDataBoxEdgeContainer_RefreshViaIdentity'; + } + if (('Refresh') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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 additional information for the specified Data Box Edge/Data Box Gateway device. +.Description +Gets additional information for the specified Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/update-azdataboxedgedeviceextendedinformation +#> +function Update-AzDataBoxEdgeDeviceExtendedInformation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The name for Channel Integrity Key stored in the Client Key Vault + ${ChannelIntegrityKeyName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The version of Channel Integrity Key stored in the Client Key Vault + ${ChannelIntegrityKeyVersion}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The Key Vault ARM Id for client secrets + ${ClientSecretStoreId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The url to access the Client Key Vault + ${ClientSecretStoreUrl}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus] + # For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status will not be applicable. + ${SyncStatus}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Update-AzDataBoxEdgeDeviceExtendedInformation_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DataBoxEdge.private\Update-AzDataBoxEdgeDeviceExtendedInformation_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.DataBoxEdge.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.DataBoxEdge.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 security settings on a Data Box Edge/Data Box Gateway device. +.Description +Updates the security settings on a Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/update-azdataboxedgedevicesecuritysetting +#> +function Update-AzDataBoxEdgeDeviceSecuritySetting { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm] + # The algorithm used to encrypt "Value". + ${DeviceAdminPasswordEncryptionAlgorithm}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The value of the secret. + ${DeviceAdminPasswordValue}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Thumbprint certificate used to encrypt \"Value\". + # If the value is unencrypted, it will be null. + ${DeviceAdminPasswordEncryptionCertThumbprint}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Update-AzDataBoxEdgeDeviceSecuritySetting_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DataBoxEdge.private\Update-AzDataBoxEdgeDeviceSecuritySetting_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.DataBoxEdge.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.DataBoxEdge.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 +Modifies a Data Box Edge/Data Box Gateway resource. +.Description +Modifies a Data Box Edge/Data Box Gateway resource. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/update-azdataboxedgedevice +#> +function Update-AzDataBoxEdgeDevice { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('DeviceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType] + # Identity type + ${IdentityType}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The path ID that uniquely identifies the subscription of the edge profile. + ${PropertiesEdgeProfileSubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags]))] + [System.Collections.Hashtable] + # The tags attached to the Data Box Edge/Gateway resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Update-AzDataBoxEdgeDevice_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DataBoxEdge.private\Update-AzDataBoxEdgeDevice_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded', 'UpdateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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 +Refreshes the share metadata with the data from the cloud. +.Description +Refreshes the share metadata with the data from the cloud. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/update-azdataboxedgeshare +#> +function Update-AzDataBoxEdgeShare { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Refresh', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Refresh', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Refresh', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The share name. + ${Name}, + + [Parameter(ParameterSetName='Refresh', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Refresh')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RefreshViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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 = @{ + Refresh = 'Az.DataBoxEdge.private\Update-AzDataBoxEdgeShare_Refresh'; + RefreshViaIdentity = 'Az.DataBoxEdge.private\Update-AzDataBoxEdgeShare_RefreshViaIdentity'; + } + if (('Refresh') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/README.md b/swaggerci/databoxedge/exports/README.md new file mode 100644 index 000000000000..68ced0b9f8e9 --- /dev/null +++ b/swaggerci/databoxedge/exports/README.md @@ -0,0 +1,20 @@ +# Exports +This directory contains the cmdlets *exported by* `Az.DataBoxEdge`. No other cmdlets in this repository are directly exported. What that means is the `Az.DataBoxEdge` 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.DataBoxEdge.private.dll`) and from the `../custom/Az.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Remove-AzDataBoxEdgeAddon.ps1 b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeAddon.ps1 new file mode 100644 index 000000000000..ebe425da9d71 --- /dev/null +++ b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeAddon.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 +Deletes the addon on the device. +.Description +Deletes the addon on the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgeaddon +#> +function Remove-AzDataBoxEdgeAddon { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('AddonName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The addon name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The role name. + ${RoleName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeAddon_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeAddon_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Remove-AzDataBoxEdgeBandwidthSchedule.ps1 b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeBandwidthSchedule.ps1 new file mode 100644 index 000000000000..6ab272612165 --- /dev/null +++ b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeBandwidthSchedule.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 +Deletes the specified bandwidth schedule. +.Description +Deletes the specified bandwidth schedule. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgebandwidthschedule +#> +function Remove-AzDataBoxEdgeBandwidthSchedule { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The bandwidth schedule name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeBandwidthSchedule_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeBandwidthSchedule_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Remove-AzDataBoxEdgeContainer.ps1 b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeContainer.ps1 new file mode 100644 index 000000000000..78a1a33ad7b4 --- /dev/null +++ b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeContainer.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 +Deletes the container on the Data Box Edge/Data Box Gateway device. +.Description +Deletes the container on the Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgecontainer +#> +function Remove-AzDataBoxEdgeContainer { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ContainerName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The container name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The Storage Account Name + ${StorageAccountName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeContainer_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeContainer_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Remove-AzDataBoxEdgeDevice.ps1 b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeDevice.ps1 new file mode 100644 index 000000000000..2af7fa5b3112 --- /dev/null +++ b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeDevice.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 +Deletes the Data Box Edge/Data Box Gateway device. +.Description +Deletes the Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgedevice +#> +function Remove-AzDataBoxEdgeDevice { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('DeviceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeDevice_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeDevice_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Remove-AzDataBoxEdgeMonitoringConfig.ps1 b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeMonitoringConfig.ps1 new file mode 100644 index 000000000000..b394c43dfbbe --- /dev/null +++ b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeMonitoringConfig.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 +deletes a new metric configuration for a role. +.Description +deletes a new metric configuration for a role. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgemonitoringconfig +#> +function Remove-AzDataBoxEdgeMonitoringConfig { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The role name. + ${RoleName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeMonitoringConfig_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeMonitoringConfig_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Remove-AzDataBoxEdgeOrder.ps1 b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeOrder.ps1 new file mode 100644 index 000000000000..bbbbde1ba871 --- /dev/null +++ b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeOrder.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the order related to the device. +.Description +Deletes the order related to the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgeorder +#> +function Remove-AzDataBoxEdgeOrder { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeOrder_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeOrder_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Remove-AzDataBoxEdgeRole.ps1 b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeRole.ps1 new file mode 100644 index 000000000000..21cc62392490 --- /dev/null +++ b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeRole.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 +Deletes the role on the device. +.Description +Deletes the role on the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgerole +#> +function Remove-AzDataBoxEdgeRole { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The role name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeRole_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeRole_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Remove-AzDataBoxEdgeShare.ps1 b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeShare.ps1 new file mode 100644 index 000000000000..1853a96f0371 --- /dev/null +++ b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeShare.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 +Deletes the share on the Data Box Edge/Data Box Gateway device. +.Description +Deletes the share on the Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgeshare +#> +function Remove-AzDataBoxEdgeShare { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The share name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeShare_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeShare_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Remove-AzDataBoxEdgeStorageAccount.ps1 b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeStorageAccount.ps1 new file mode 100644 index 000000000000..381d6ab452a8 --- /dev/null +++ b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeStorageAccount.ps1 @@ -0,0 +1,220 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 StorageAccount on the Data Box Edge/Data Box Gateway device. +.Description +Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgestorageaccount +#> +function Remove-AzDataBoxEdgeStorageAccount { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('StorageAccountName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The StorageAccount name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeStorageAccount_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeStorageAccount_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Remove-AzDataBoxEdgeStorageAccountCredentials.ps1 b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeStorageAccountCredentials.ps1 new file mode 100644 index 000000000000..66ae478cf2de --- /dev/null +++ b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeStorageAccountCredentials.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 +Deletes the storage account credential. +.Description +Deletes the storage account credential. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgestorageaccountcredentials +#> +function Remove-AzDataBoxEdgeStorageAccountCredentials { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The storage account credential name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeStorageAccountCredentials_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeStorageAccountCredentials_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Remove-AzDataBoxEdgeTrigger.ps1 b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeTrigger.ps1 new file mode 100644 index 000000000000..de88c2518454 --- /dev/null +++ b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeTrigger.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 +Deletes the trigger on the gateway device. +.Description +Deletes the trigger on the gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgetrigger +#> +function Remove-AzDataBoxEdgeTrigger { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The trigger name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeTrigger_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeTrigger_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Remove-AzDataBoxEdgeUser.ps1 b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeUser.ps1 new file mode 100644 index 000000000000..e120bdf02705 --- /dev/null +++ b/swaggerci/databoxedge/exports/Remove-AzDataBoxEdgeUser.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 +Deletes the user on a databox edge/gateway device. +.Description +Deletes the user on a databox edge/gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/remove-azdataboxedgeuser +#> +function Remove-AzDataBoxEdgeUser { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The user name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Remove-AzDataBoxEdgeUser_Delete'; + DeleteViaIdentity = 'Az.DataBoxEdge.private\Remove-AzDataBoxEdgeUser_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Start-AzDataBoxEdgeSupportPackage.ps1 b/swaggerci/databoxedge/exports/Start-AzDataBoxEdgeSupportPackage.ps1 new file mode 100644 index 000000000000..a9c0acaab44b --- /dev/null +++ b/swaggerci/databoxedge/exports/Start-AzDataBoxEdgeSupportPackage.ps1 @@ -0,0 +1,255 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +Triggers support package on the device +.Description +Triggers support package on the device +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. + +TRIGGERSUPPORTPACKAGEREQUEST : The request object for trigger support package. + [Include ]: Type of files, which need to be included in the logs This will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) or a comma separated list of log types that are required + [MaximumTimeStamp ]: Start of the timespan of the log collection + [MinimumTimeStamp ]: MinimumTimeStamp from where logs need to be collected +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/start-azdataboxedgesupportpackage +#> +function Start-AzDataBoxEdgeSupportPackage { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='TriggerExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Trigger', Mandatory)] + [Parameter(ParameterSetName='TriggerExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Trigger', Mandatory)] + [Parameter(ParameterSetName='TriggerExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Trigger')] + [Parameter(ParameterSetName='TriggerExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='TriggerViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='TriggerViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Trigger', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='TriggerViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest] + # The request object for trigger support package. + # To construct, see NOTES section for TRIGGERSUPPORTPACKAGEREQUEST properties and create a hash table. + ${TriggerSupportPackageRequest}, + + [Parameter(ParameterSetName='TriggerExpanded')] + [Parameter(ParameterSetName='TriggerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Type of files, which need to be included in the logsThis will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived)or a comma separated list of log types that are required + ${Include}, + + [Parameter(ParameterSetName='TriggerExpanded')] + [Parameter(ParameterSetName='TriggerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.DateTime] + # Start of the timespan of the log collection + ${MaximumTimeStamp}, + + [Parameter(ParameterSetName='TriggerExpanded')] + [Parameter(ParameterSetName='TriggerViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.DateTime] + # MinimumTimeStamp from where logs need to be collected + ${MinimumTimeStamp}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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 = @{ + Trigger = 'Az.DataBoxEdge.private\Start-AzDataBoxEdgeSupportPackage_Trigger'; + TriggerExpanded = 'Az.DataBoxEdge.private\Start-AzDataBoxEdgeSupportPackage_TriggerExpanded'; + TriggerViaIdentity = 'Az.DataBoxEdge.private\Start-AzDataBoxEdgeSupportPackage_TriggerViaIdentity'; + TriggerViaIdentityExpanded = 'Az.DataBoxEdge.private\Start-AzDataBoxEdgeSupportPackage_TriggerViaIdentityExpanded'; + } + if (('Trigger', 'TriggerExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility.ps1 b/swaggerci/databoxedge/exports/Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility.ps1 new file mode 100644 index 000000000000..14fee43372d7 --- /dev/null +++ b/swaggerci/databoxedge/exports/Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility.ps1 @@ -0,0 +1,266 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 +Posts the device capacity request info to check feasibility. +.Description +Posts the device capacity request info to check feasibility. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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. + +DEVICECAPACITYREQUESTINFO : Object for Capturing DeviceCapacityRequestInfo + VMPlacementQuery : Array containing the sizes of the VMs for checking if its feasible to create them on the appliance. + [VMPlacementResult ]: Array of the VMs of the sizes in VmSizes can be provisioned on the appliance. + [IsFeasible ]: Boolean value indicating if the VM(s) in VmSize can be created. + [Message ]: Localized message to be displayed to the user to explain the check result. + [MessageCode ]: MessageCode indicating reason for success or failure. + [VMSize ]: List of VM sizes being checked. + +INPUTOBJECT : Identity Parameter + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. + +VMPLACEMENTRESULT : Array of the VMs of the sizes in VmSizes can be provisioned on the appliance. + [IsFeasible ]: Boolean value indicating if the VM(s) in VmSize can be created. + [Message ]: Localized message to be displayed to the user to explain the check result. + [MessageCode ]: MessageCode indicating reason for success or failure. + [VMSize ]: List of VM sizes being checked. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/test-azdataboxedgedevicecapacitycheckresourcecreationfeasibility +#> +function Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CheckExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Check', Mandatory)] + [Parameter(ParameterSetName='CheckExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Check', Mandatory)] + [Parameter(ParameterSetName='CheckExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Check')] + [Parameter(ParameterSetName='CheckExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CheckViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Query')] + [System.String] + # The capacity name. + ${CapacityName}, + + [Parameter(ParameterSetName='Check', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo] + # Object for Capturing DeviceCapacityRequestInfo + # To construct, see NOTES section for DEVICECAPACITYREQUESTINFO properties and create a hash table. + ${DeviceCapacityRequestInfo}, + + [Parameter(ParameterSetName='CheckExpanded', Mandatory)] + [Parameter(ParameterSetName='CheckViaIdentityExpanded', Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String[][]] + # Array containing the sizes of the VMs for checking if its feasible to create them on the appliance. + ${VMPlacementQuery}, + + [Parameter(ParameterSetName='CheckExpanded')] + [Parameter(ParameterSetName='CheckViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult[]] + # Array of the VMs of the sizes in VmSizes can be provisioned on the appliance. + # To construct, see NOTES section for VMPLACEMENTRESULT properties and create a hash table. + ${VMPlacementResult}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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 = @{ + Check = 'Az.DataBoxEdge.private\Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_Check'; + CheckExpanded = 'Az.DataBoxEdge.private\Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckExpanded'; + CheckViaIdentity = 'Az.DataBoxEdge.private\Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentity'; + CheckViaIdentityExpanded = 'Az.DataBoxEdge.private\Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentityExpanded'; + } + if (('Check', 'CheckExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Update-AzDataBoxEdgeContainer.ps1 b/swaggerci/databoxedge/exports/Update-AzDataBoxEdgeContainer.ps1 new file mode 100644 index 000000000000..4497033d3b37 --- /dev/null +++ b/swaggerci/databoxedge/exports/Update-AzDataBoxEdgeContainer.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 +Refreshes the container metadata with the data from the cloud. +.Description +Refreshes the container metadata with the data from the cloud. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/update-azdataboxedgecontainer +#> +function Update-AzDataBoxEdgeContainer { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Refresh', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Refresh', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Refresh', Mandatory)] + [Alias('ContainerName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The container name. + ${Name}, + + [Parameter(ParameterSetName='Refresh', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Refresh', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The Storage Account Name + ${StorageAccountName}, + + [Parameter(ParameterSetName='Refresh')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RefreshViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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 = @{ + Refresh = 'Az.DataBoxEdge.private\Update-AzDataBoxEdgeContainer_Refresh'; + RefreshViaIdentity = 'Az.DataBoxEdge.private\Update-AzDataBoxEdgeContainer_RefreshViaIdentity'; + } + if (('Refresh') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Update-AzDataBoxEdgeDevice.ps1 b/swaggerci/databoxedge/exports/Update-AzDataBoxEdgeDevice.ps1 new file mode 100644 index 000000000000..b99cbd951e19 --- /dev/null +++ b/swaggerci/databoxedge/exports/Update-AzDataBoxEdgeDevice.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Modifies a Data Box Edge/Data Box Gateway resource. +.Description +Modifies a Data Box Edge/Data Box Gateway resource. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/update-azdataboxedgedevice +#> +function Update-AzDataBoxEdgeDevice { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('DeviceName')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType] + # Identity type + ${IdentityType}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The path ID that uniquely identifies the subscription of the edge profile. + ${PropertiesEdgeProfileSubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags]))] + [System.Collections.Hashtable] + # The tags attached to the Data Box Edge/Gateway resource. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Update-AzDataBoxEdgeDevice_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DataBoxEdge.private\Update-AzDataBoxEdgeDevice_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded', 'UpdateViaIdentityExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Update-AzDataBoxEdgeDeviceExtendedInformation.ps1 b/swaggerci/databoxedge/exports/Update-AzDataBoxEdgeDeviceExtendedInformation.ps1 new file mode 100644 index 000000000000..5d8566d44d7d --- /dev/null +++ b/swaggerci/databoxedge/exports/Update-AzDataBoxEdgeDeviceExtendedInformation.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 +Gets additional information for the specified Data Box Edge/Data Box Gateway device. +.Description +Gets additional information for the specified Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/update-azdataboxedgedeviceextendedinformation +#> +function Update-AzDataBoxEdgeDeviceExtendedInformation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The name for Channel Integrity Key stored in the Client Key Vault + ${ChannelIntegrityKeyName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The version of Channel Integrity Key stored in the Client Key Vault + ${ChannelIntegrityKeyVersion}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The Key Vault ARM Id for client secrets + ${ClientSecretStoreId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The url to access the Client Key Vault + ${ClientSecretStoreUrl}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus] + # For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status will not be applicable. + ${SyncStatus}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Update-AzDataBoxEdgeDeviceExtendedInformation_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DataBoxEdge.private\Update-AzDataBoxEdgeDeviceExtendedInformation_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Update-AzDataBoxEdgeDeviceSecuritySetting.ps1 b/swaggerci/databoxedge/exports/Update-AzDataBoxEdgeDeviceSecuritySetting.ps1 new file mode 100644 index 000000000000..3073f70a6650 --- /dev/null +++ b/swaggerci/databoxedge/exports/Update-AzDataBoxEdgeDeviceSecuritySetting.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 +Updates the security settings on a Data Box Edge/Data Box Gateway device. +.Description +Updates the security settings on a Data Box Edge/Data Box Gateway device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/update-azdataboxedgedevicesecuritysetting +#> +function Update-AzDataBoxEdgeDeviceSecuritySetting { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm])] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm] + # The algorithm used to encrypt "Value". + ${DeviceAdminPasswordEncryptionAlgorithm}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # The value of the secret. + ${DeviceAdminPasswordValue}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Body')] + [System.String] + # Thumbprint certificate used to encrypt \"Value\". + # If the value is unencrypted, it will be null. + ${DeviceAdminPasswordEncryptionCertThumbprint}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.private\Update-AzDataBoxEdgeDeviceSecuritySetting_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DataBoxEdge.private\Update-AzDataBoxEdgeDeviceSecuritySetting_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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/exports/Update-AzDataBoxEdgeShare.ps1 b/swaggerci/databoxedge/exports/Update-AzDataBoxEdgeShare.ps1 new file mode 100644 index 000000000000..9623f03e58d6 --- /dev/null +++ b/swaggerci/databoxedge/exports/Update-AzDataBoxEdgeShare.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 +Refreshes the share metadata with the data from the cloud. +.Description +Refreshes the share metadata with the data from the cloud. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity +.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 + [AddonName ]: The addon name. + [ContainerName ]: The container Name + [DeviceName ]: The device name. + [Id ]: Resource identity path + [Name ]: The alert name. + [ResourceGroupName ]: The resource group name. + [RoleName ]: The role name. + [StorageAccountName ]: The storage account name. + [SubscriptionId ]: The subscription ID. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/update-azdataboxedgeshare +#> +function Update-AzDataBoxEdgeShare { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Refresh', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Refresh', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Refresh', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The share name. + ${Name}, + + [Parameter(ParameterSetName='Refresh', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [System.String] + # The resource group name. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Refresh')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription ID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RefreshViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity] + # 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.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Runspace.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.DataBoxEdge.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 = @{ + Refresh = 'Az.DataBoxEdge.private\Update-AzDataBoxEdgeShare_Refresh'; + RefreshViaIdentity = 'Az.DataBoxEdge.private\Update-AzDataBoxEdgeShare_RefreshViaIdentity'; + } + if (('Refresh') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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/databoxedge/generate-help.ps1 b/swaggerci/databoxedge/generate-help.ps1 new file mode 100644 index 000000000000..dc095556e332 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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.DataBoxEdge.private.dll') +$instance = [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/Module.cs b/swaggerci/databoxedge/generated/Module.cs new file mode 100644 index 000000000000..f544684dd4ca --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.HttpPipeline _pipeline; + + /// the ISendAsync pipeline instance (when proxy is enabled) + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.DataBoxEdgeManagementClient 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.DataBoxEdge.Module _instance; + + /// the singleton of this module class + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module()); + + /// The Name of this module + public string Name => @"Az.DataBoxEdge"; + + /// 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.DataBoxEdge"; + + /// 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.HttpPipeline for the remote call. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.DataBoxEdgeManagementClient(); + _handler.Proxy = _webProxy; + _pipeline = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient())); + _pipelineWithProxy = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/DataBoxEdgeManagementClient.cs b/swaggerci/databoxedge/generated/api/DataBoxEdgeManagementClient.cs new file mode 100644 index 000000000000..857627690c82 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/DataBoxEdgeManagementClient.cs @@ -0,0 +1,16902 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// Low-level API implementation for the DataBoxEdgeManagementClient service. + /// + public partial class DataBoxEdgeManagementClient + { + + /// Create or update a addon. + /// The device name. + /// The role name. + /// The addon name. + /// The subscription ID. + /// The resource group name. + /// The addon properties. + /// 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.DataBoxEdge.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 AddonsCreateOrUpdate(string deviceName, string roleName, string addonName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/roles/" + + global::System.Uri.EscapeDataString(roleName) + + "/addons/" + + global::System.Uri.EscapeDataString(addonName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AddonsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Create or update a addon. + /// + /// The addon properties. + /// 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.DataBoxEdge.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 AddonsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/roles/(?[^/]+)/addons/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var roleName = _match.Groups["roleName"].Value; + var addonName = _match.Groups["addonName"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/roles/" + + roleName + + "/addons/" + + addonName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AddonsCreateOrUpdate_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.DataBoxEdge.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 AddonsCreateOrUpdate_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Addon.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 role name. + /// The addon name. + /// The subscription ID. + /// The resource group name. + /// The addon properties. + /// 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 AddonsCreateOrUpdate_Validate(string deviceName, string roleName, string addonName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(roleName),roleName); + await eventListener.AssertNotNull(nameof(addonName),addonName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the addon on the device. + /// The device name. + /// The role name. + /// The addon name. + /// 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 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.DataBoxEdge.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 AddonsDelete(string deviceName, string roleName, string addonName, string subscriptionId, string resourceGroupName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/roles/" + + global::System.Uri.EscapeDataString(roleName) + + "/addons/" + + global::System.Uri.EscapeDataString(addonName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AddonsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the addon on the device. + /// + /// 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.DataBoxEdge.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 AddonsDeleteViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/roles/(?[^/]+)/addons/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var roleName = _match.Groups["roleName"].Value; + var addonName = _match.Groups["addonName"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/roles/" + + roleName + + "/addons/" + + addonName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AddonsDelete_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.DataBoxEdge.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 AddonsDelete_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 role name. + /// The addon name. + /// 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 AddonsDelete_Validate(string deviceName, string roleName, string addonName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(roleName),roleName); + await eventListener.AssertNotNull(nameof(addonName),addonName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Gets a specific addon by name. + /// The device name. + /// The role name. + /// The addon name. + /// 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.DataBoxEdge.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 AddonsGet(string deviceName, string roleName, string addonName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/roles/" + + global::System.Uri.EscapeDataString(roleName) + + "/addons/" + + global::System.Uri.EscapeDataString(addonName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AddonsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a specific addon by 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.DataBoxEdge.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 AddonsGetViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/roles/(?[^/]+)/addons/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var roleName = _match.Groups["roleName"].Value; + var addonName = _match.Groups["addonName"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/roles/" + + roleName + + "/addons/" + + addonName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AddonsGet_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.DataBoxEdge.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 AddonsGet_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Addon.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 role name. + /// The addon name. + /// 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 AddonsGet_Validate(string deviceName, string roleName, string addonName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(roleName),roleName); + await eventListener.AssertNotNull(nameof(addonName),addonName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Lists all the addons configured in the role. + /// The device name. + /// The role name. + /// 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.DataBoxEdge.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 AddonsListByRole(string deviceName, string roleName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/roles/" + + global::System.Uri.EscapeDataString(roleName) + + "/addons" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AddonsListByRole_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all the addons configured in the role. + /// + /// 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.DataBoxEdge.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 AddonsListByRoleViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/roles/(?[^/]+)/addons$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var roleName = _match.Groups["roleName"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/roles/" + + roleName + + "/addons" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AddonsListByRole_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.DataBoxEdge.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 AddonsListByRole_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AddonList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 role name. + /// 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 AddonsListByRole_Validate(string deviceName, string roleName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(roleName),roleName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Gets an alert by name. + /// The device name. + /// The alert name. + /// 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.DataBoxEdge.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 AlertsGet(string deviceName, string name, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/alerts/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AlertsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets an alert by 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.DataBoxEdge.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 AlertsGetViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/alerts/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AlertsGet_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.DataBoxEdge.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 AlertsGet_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Alert.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 alert name. + /// 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 AlertsGet_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Gets all the alerts for a Data Box Edge/Data Box Gateway device. + /// The device name. + /// 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.DataBoxEdge.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 AlertsListByDataBoxEdgeDevice(string deviceName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/alerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AlertsListByDataBoxEdgeDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets all the alerts for a Data Box Edge/Data Box Gateway 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.DataBoxEdge.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 AlertsListByDataBoxEdgeDeviceViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts'"); + } + + // 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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/alerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AlertsListByDataBoxEdgeDevice_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.DataBoxEdge.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 AlertsListByDataBoxEdgeDevice_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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 AlertsListByDataBoxEdgeDevice_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// List all the available Skus and information related to them. + /// 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.DataBoxEdge.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 AvailableSkusList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.DataBoxEdge/availableSkus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AvailableSkusList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the available Skus and information related to them. + /// + /// 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.DataBoxEdge.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 AvailableSkusListViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/availableSkus$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/availableSkus'"); + } + + // 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.DataBoxEdge/availableSkus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AvailableSkusList_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.DataBoxEdge.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 AvailableSkusList_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeSkuList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 AvailableSkusList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// Creates or updates a bandwidth schedule. + /// The device name. + /// The bandwidth schedule name which needs to be added/updated. + /// The subscription ID. + /// The resource group name. + /// The bandwidth schedule 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.DataBoxEdge.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 BandwidthSchedulesCreateOrUpdate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/bandwidthSchedules/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BandwidthSchedulesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or updates a bandwidth schedule. + /// + /// The bandwidth schedule 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.DataBoxEdge.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 BandwidthSchedulesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/bandwidthSchedules/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/bandwidthSchedules/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BandwidthSchedulesCreateOrUpdate_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.DataBoxEdge.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 BandwidthSchedulesCreateOrUpdate_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.BandwidthSchedule.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 bandwidth schedule name which needs to be added/updated. + /// The subscription ID. + /// The resource group name. + /// The bandwidth schedule 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 BandwidthSchedulesCreateOrUpdate_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the specified bandwidth schedule. + /// The device name. + /// The bandwidth schedule name. + /// 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 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.DataBoxEdge.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 BandwidthSchedulesDelete(string deviceName, string name, string subscriptionId, string resourceGroupName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/bandwidthSchedules/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BandwidthSchedulesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the specified bandwidth schedule. + /// + /// 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.DataBoxEdge.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 BandwidthSchedulesDeleteViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/bandwidthSchedules/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/bandwidthSchedules/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BandwidthSchedulesDelete_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.DataBoxEdge.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 BandwidthSchedulesDelete_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 bandwidth schedule name. + /// 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 BandwidthSchedulesDelete_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Gets the properties of the specified bandwidth schedule. + /// The device name. + /// The bandwidth schedule name. + /// 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.DataBoxEdge.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 BandwidthSchedulesGet(string deviceName, string name, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/bandwidthSchedules/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BandwidthSchedulesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the properties of the specified bandwidth schedule. + /// + /// 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.DataBoxEdge.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 BandwidthSchedulesGetViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/bandwidthSchedules/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/bandwidthSchedules/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BandwidthSchedulesGet_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.DataBoxEdge.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 BandwidthSchedulesGet_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.BandwidthSchedule.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 bandwidth schedule name. + /// 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 BandwidthSchedulesGet_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + /// The device name. + /// 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.DataBoxEdge.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 BandwidthSchedulesListByDataBoxEdgeDevice(string deviceName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/bandwidthSchedules" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BandwidthSchedulesListByDataBoxEdgeDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway 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.DataBoxEdge.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 BandwidthSchedulesListByDataBoxEdgeDeviceViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/bandwidthSchedules$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules'"); + } + + // 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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/bandwidthSchedules" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BandwidthSchedulesListByDataBoxEdgeDevice_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.DataBoxEdge.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 BandwidthSchedulesListByDataBoxEdgeDevice_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.BandwidthSchedulesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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 BandwidthSchedulesListByDataBoxEdgeDevice_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Creates a new container or updates an existing container on the device. + /// The device name. + /// The Storage Account Name + /// The container name. + /// The subscription ID. + /// The resource group name. + /// The container properties. + /// 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.DataBoxEdge.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 ContainersCreateOrUpdate(string deviceName, string storageAccountName, string containerName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/storageAccounts/" + + global::System.Uri.EscapeDataString(storageAccountName) + + "/containers/" + + global::System.Uri.EscapeDataString(containerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContainersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates a new container or updates an existing container on the device. + /// + /// The container properties. + /// 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.DataBoxEdge.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 ContainersCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/storageAccounts/(?[^/]+)/containers/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var storageAccountName = _match.Groups["storageAccountName"].Value; + var containerName = _match.Groups["containerName"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/storageAccounts/" + + storageAccountName + + "/containers/" + + containerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContainersCreateOrUpdate_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.DataBoxEdge.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 ContainersCreateOrUpdate_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Container.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 Storage Account Name + /// The container name. + /// The subscription ID. + /// The resource group name. + /// The container properties. + /// 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 ContainersCreateOrUpdate_Validate(string deviceName, string storageAccountName, string containerName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(storageAccountName),storageAccountName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the container on the Data Box Edge/Data Box Gateway device. + /// The device name. + /// The Storage Account Name + /// The container name. + /// The subscription ID. + /// The resource group 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.DataBoxEdge.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 ContainersDelete(string deviceName, string storageAccountName, string containerName, string subscriptionId, string resourceGroupName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/storageAccounts/" + + global::System.Uri.EscapeDataString(storageAccountName) + + "/containers/" + + global::System.Uri.EscapeDataString(containerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContainersDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the container on the Data Box Edge/Data Box Gateway 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.DataBoxEdge.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 ContainersDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/storageAccounts/(?[^/]+)/containers/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var storageAccountName = _match.Groups["storageAccountName"].Value; + var containerName = _match.Groups["containerName"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/storageAccounts/" + + storageAccountName + + "/containers/" + + containerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContainersDelete_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.DataBoxEdge.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 ContainersDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 Storage Account Name + /// The container name. + /// 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 ContainersDelete_Validate(string deviceName, string storageAccountName, string containerName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(storageAccountName),storageAccountName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Gets a container by name. + /// The device name. + /// The Storage Account Name + /// The container Name + /// 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.DataBoxEdge.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 ContainersGet(string deviceName, string storageAccountName, string containerName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/storageAccounts/" + + global::System.Uri.EscapeDataString(storageAccountName) + + "/containers/" + + global::System.Uri.EscapeDataString(containerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContainersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a container by 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.DataBoxEdge.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 ContainersGetViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/storageAccounts/(?[^/]+)/containers/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var storageAccountName = _match.Groups["storageAccountName"].Value; + var containerName = _match.Groups["containerName"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/storageAccounts/" + + storageAccountName + + "/containers/" + + containerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContainersGet_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.DataBoxEdge.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 ContainersGet_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Container.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 Storage Account Name + /// The container Name + /// 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 ContainersGet_Validate(string deviceName, string storageAccountName, string containerName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(storageAccountName),storageAccountName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// + /// Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + /// + /// The device name. + /// The storage Account name. + /// 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.DataBoxEdge.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 ContainersListByStorageAccount(string deviceName, string storageAccountName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/storageAccounts/" + + global::System.Uri.EscapeDataString(storageAccountName) + + "/containers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContainersListByStorageAccount_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway 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.DataBoxEdge.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 ContainersListByStorageAccountViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/storageAccounts/(?[^/]+)/containers$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var storageAccountName = _match.Groups["storageAccountName"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/storageAccounts/" + + storageAccountName + + "/containers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContainersListByStorageAccount_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.DataBoxEdge.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 ContainersListByStorageAccount_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContainerList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 storage Account name. + /// 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 ContainersListByStorageAccount_Validate(string deviceName, string storageAccountName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(storageAccountName),storageAccountName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Refreshes the container metadata with the data from the cloud. + /// The device name. + /// The Storage Account Name + /// The container name. + /// 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.DataBoxEdge.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 ContainersRefresh(string deviceName, string storageAccountName, string containerName, string subscriptionId, string resourceGroupName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/storageAccounts/" + + global::System.Uri.EscapeDataString(storageAccountName) + + "/containers/" + + global::System.Uri.EscapeDataString(containerName) + + "/refresh" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContainersRefresh_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Refreshes the container metadata with the data from the cloud. + /// + /// 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.DataBoxEdge.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 ContainersRefreshViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/storageAccounts/(?[^/]+)/containers/(?[^/]+)/refresh$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}/refresh'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var storageAccountName = _match.Groups["storageAccountName"].Value; + var containerName = _match.Groups["containerName"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/storageAccounts/" + + storageAccountName + + "/containers/" + + containerName + + "/refresh" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ContainersRefresh_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.DataBoxEdge.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 ContainersRefresh_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 Storage Account Name + /// The container name. + /// 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 ContainersRefresh_Validate(string deviceName, string storageAccountName, string containerName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(storageAccountName),storageAccountName); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Posts the device capacity request info to check feasibility. + /// The subscription ID. + /// The resource group name. + /// The device name. + /// The capacity name. + /// The device capacity request info. + /// 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.DataBoxEdge.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 DeviceCapacityCheckResourceCreationFeasibility(string subscriptionId, string resourceGroupName, string deviceName, string capacityName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/deviceCapacityCheck" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(capacityName) ? global::System.String.Empty : "capacityName=" + global::System.Uri.EscapeDataString(capacityName)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DeviceCapacityCheckResourceCreationFeasibility_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Posts the device capacity request info to check feasibility. + /// + /// The capacity name. + /// The device capacity request info. + /// 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.DataBoxEdge.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 DeviceCapacityCheckResourceCreationFeasibilityViaIdentity(global::System.String viaIdentity, string capacityName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/deviceCapacityCheck$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/deviceCapacityCheck'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var deviceName = _match.Groups["deviceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/deviceCapacityCheck" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(capacityName) ? global::System.String.Empty : "capacityName=" + global::System.Uri.EscapeDataString(capacityName)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DeviceCapacityCheckResourceCreationFeasibility_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.DataBoxEdge.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 DeviceCapacityCheckResourceCreationFeasibility_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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: azure-async-operation + var _finalUri = _response.GetFirstHeader(@"Azure-AsyncOperation"); + 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 device name. + /// The capacity name. + /// The device capacity request info. + /// 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 DeviceCapacityCheckResourceCreationFeasibility_Validate(string subscriptionId, string resourceGroupName, string deviceName, string capacityName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(capacityName),capacityName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Gets the properties of the specified device capacity info. + /// The subscription ID. + /// The resource group name. + /// The 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.DataBoxEdge.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 DeviceCapacityInfoGetDeviceCapacityInfo(string subscriptionId, string resourceGroupName, string deviceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/deviceCapacityInfo/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DeviceCapacityInfoGetDeviceCapacityInfo_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the properties of the specified device capacity info. + /// + /// 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.DataBoxEdge.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 DeviceCapacityInfoGetDeviceCapacityInfoViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/deviceCapacityInfo/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/deviceCapacityInfo/default'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var deviceName = _match.Groups["deviceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/deviceCapacityInfo/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DeviceCapacityInfoGetDeviceCapacityInfo_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.DataBoxEdge.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 DeviceCapacityInfoGetDeviceCapacityInfo_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityInfo.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 device 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 DeviceCapacityInfoGetDeviceCapacityInfo_Validate(string subscriptionId, string resourceGroupName, string deviceName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + } + } + + /// Creates or updates a Data Box Edge/Data Box Gateway resource. + /// The device name. + /// The subscription ID. + /// The resource group name. + /// The resource object. + /// 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.DataBoxEdge.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 DevicesCreateOrUpdate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the security settings on a Data Box Edge/Data Box Gateway device. + /// The device name. + /// The subscription ID. + /// The resource group 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.DataBoxEdge.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, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettings body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/securitySettings/default/update" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesCreateOrUpdateSecuritySettings_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Updates the security settings on a Data Box Edge/Data Box Gateway device. + /// + /// 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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.ISecuritySettings body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/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.DataBoxEdge/dataBoxEdgeDevices/{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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/securitySettings/default/update" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettings body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates or updates a Data Box Edge/Data Box Gateway resource. + /// + /// The resource object. + /// 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.DataBoxEdge.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 DevicesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesCreateOrUpdate_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.DataBoxEdge.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 DevicesCreateOrUpdate_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 resource object. + /// 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 DevicesCreateOrUpdate_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the Data Box Edge/Data Box Gateway device. + /// The device name. + /// 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 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.DataBoxEdge.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, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the Data Box Edge/Data Box Gateway device. + /// + /// 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.DataBoxEdge.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 onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesDelete_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.DataBoxEdge.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 onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Downloads the updates on a Data Box Edge/Data Box Gateway device. + /// The device name. + /// 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.DataBoxEdge.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, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/downloadUpdates" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesDownloadUpdates_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Downloads the updates on a Data Box Edge/Data Box Gateway 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.DataBoxEdge.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 onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/downloadUpdates$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'"); + } + + // 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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/downloadUpdates" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesDownloadUpdates_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.DataBoxEdge.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 onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Generates certificate for activation key. + /// The device name. + /// 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.DataBoxEdge.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 DevicesGenerateCertificate(string deviceName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/generateCertificate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesGenerateCertificate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Generates certificate for activation key. + /// + /// 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.DataBoxEdge.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 DevicesGenerateCertificateViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/generateCertificate$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/generateCertificate'"); + } + + // 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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/generateCertificate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesGenerateCertificate_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.DataBoxEdge.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 DevicesGenerateCertificate_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.GenerateCertResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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 DevicesGenerateCertificate_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Gets the properties of the Data Box Edge/Data Box Gateway device. + /// The device name. + /// 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.DataBoxEdge.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, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. + /// + /// The device name. + /// 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.DataBoxEdge.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 DevicesGetExtendedInformation(string deviceName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/getExtendedInformation" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesGetExtendedInformation_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets additional information for the specified Azure Stack Edge/Data Box Gateway 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.DataBoxEdge.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 DevicesGetExtendedInformationViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/getExtendedInformation$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation'"); + } + + // 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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/getExtendedInformation" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesGetExtendedInformation_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.DataBoxEdge.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 DevicesGetExtendedInformation_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfo.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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 DevicesGetExtendedInformation_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// + /// Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + /// + /// The device name. + /// 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.DataBoxEdge.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, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/networkSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesGetNetworkSettings_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the network settings of the specified Data Box Edge/Data Box Gateway 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.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/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.DataBoxEdge/dataBoxEdgeDevices/{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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/networkSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkSettings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// + /// Gets information about the availability of updates based on the last scan of the device. It also gets information about + /// any ongoing download or install jobs on the device. + /// + /// The device name. + /// 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.DataBoxEdge.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, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/updateSummary/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesGetUpdateSummary_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets information about the availability of updates based on the last scan of the device. It also gets information about + /// any ongoing download or install jobs on 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.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/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.DataBoxEdge/dataBoxEdgeDevices/{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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/updateSummary/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateSummary.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Gets the properties of the Data Box Edge/Data Box Gateway 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.DataBoxEdge.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, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Installs the updates on the Data Box Edge/Data Box Gateway device. + /// The device name. + /// 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.DataBoxEdge.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, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/installUpdates" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesInstallUpdates_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Installs the updates on the Data Box Edge/Data Box Gateway 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.DataBoxEdge.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 onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/installUpdates$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'"); + } + + // 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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/installUpdates" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesInstallUpdates_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.DataBoxEdge.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 onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + /// The subscription ID. + /// The resource group name. + /// Specify $expand=details to populate additional fields related to the resource or Specify $skipToken= + /// to populate the next page in the list. + /// 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.DataBoxEdge.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 DevicesListByResourceGroup(string subscriptionId, string resourceGroupName, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices" + + "?" + + "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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + /// + /// Specify $expand=details to populate additional fields related to the resource or Specify $skipToken= + /// to populate the next page in the list. + /// 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.DataBoxEdge.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 DevicesListByResourceGroupViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices$", 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.DataBoxEdge/dataBoxEdgeDevices'"); + } + + // 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.DataBoxEdge/dataBoxEdgeDevices" + + "?" + + "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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesListByResourceGroup_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.DataBoxEdge.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 DevicesListByResourceGroup_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// Specify $expand=details to populate additional fields related to the resource or Specify $skipToken= + /// to populate the next page in the list. + /// 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 DevicesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(Expand),Expand); + } + } + + /// Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + /// The subscription ID. + /// Specify $expand=details to populate additional fields related to the resource or Specify $skipToken= + /// to populate the next page in the list. + /// 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.DataBoxEdge.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 DevicesListBySubscription(string subscriptionId, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices" + + "?" + + "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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + /// + /// Specify $expand=details to populate additional fields related to the resource or Specify $skipToken= + /// to populate the next page in the list. + /// 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.DataBoxEdge.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 DevicesListBySubscriptionViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices'"); + } + + // 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.DataBoxEdge/dataBoxEdgeDevices" + + "?" + + "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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesListBySubscription_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.DataBoxEdge.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 DevicesListBySubscription_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// Specify $expand=details to populate additional fields related to the resource or Specify $skipToken= + /// to populate the next page in the list. + /// 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 DevicesListBySubscription_Validate(string subscriptionId, string Expand, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Expand),Expand); + } + } + + /// Scans for updates on a Data Box Edge/Data Box Gateway device. + /// The device name. + /// 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.DataBoxEdge.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, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/scanForUpdates" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesScanForUpdates_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Scans for updates on a Data Box Edge/Data Box Gateway 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.DataBoxEdge.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 onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/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.DataBoxEdge/dataBoxEdgeDevices/{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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/scanForUpdates" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesScanForUpdates_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.DataBoxEdge.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 onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Modifies a Data Box Edge/Data Box Gateway resource. + /// The device name. + /// The subscription ID. + /// The resource group name. + /// The resource 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.DataBoxEdge.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 DevicesUpdate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets additional information for the specified Data Box Edge/Data Box Gateway device. + /// + /// The device name. + /// The subscription ID. + /// The resource group name. + /// The patch object. + /// 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.DataBoxEdge.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 DevicesUpdateExtendedInformation(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/updateExtendedInformation" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesUpdateExtendedInformation_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets additional information for the specified Data Box Edge/Data Box Gateway device. + /// + /// + /// The patch object. + /// 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.DataBoxEdge.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 DevicesUpdateExtendedInformationViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/updateExtendedInformation$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateExtendedInformation'"); + } + + // 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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/updateExtendedInformation" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesUpdateExtendedInformation_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.DataBoxEdge.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 DevicesUpdateExtendedInformation_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfo.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 patch object. + /// 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 DevicesUpdateExtendedInformation_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatch body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Modifies a Data Box Edge/Data Box Gateway resource. + /// + /// The resource 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.DataBoxEdge.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 DevicesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesUpdate_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.DataBoxEdge.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 DevicesUpdate_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevice.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 resource 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 DevicesUpdate_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatch body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Uploads registration certificate for the device. + /// The device name. + /// The subscription ID. + /// The resource group name. + /// The upload certificate 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.DataBoxEdge.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 DevicesUploadCertificate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/uploadCertificate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesUploadCertificate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Uploads registration certificate for the device. + /// + /// The upload certificate 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.DataBoxEdge.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 DevicesUploadCertificateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/uploadCertificate$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate'"); + } + + // 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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/uploadCertificate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesUploadCertificate_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.DataBoxEdge.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 DevicesUploadCertificate_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UploadCertificateResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 upload certificate 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 DevicesUploadCertificate_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. + /// + /// The device name. + /// 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.DataBoxEdge.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 DiagnosticSettingsGetDiagnosticProactiveLogCollectionSettings(string deviceName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/diagnosticProactiveLogCollectionSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticSettingsGetDiagnosticProactiveLogCollectionSettings_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway 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.DataBoxEdge.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 DiagnosticSettingsGetDiagnosticProactiveLogCollectionSettingsViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/diagnosticProactiveLogCollectionSettings/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticProactiveLogCollectionSettings/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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/diagnosticProactiveLogCollectionSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticSettingsGetDiagnosticProactiveLogCollectionSettings_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.DataBoxEdge.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 DiagnosticSettingsGetDiagnosticProactiveLogCollectionSettings_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DiagnosticProactiveLogCollectionSettings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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 DiagnosticSettingsGetDiagnosticProactiveLogCollectionSettings_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// + /// Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. + /// + /// The device name. + /// 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.DataBoxEdge.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 DiagnosticSettingsGetDiagnosticRemoteSupportSettings(string deviceName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/diagnosticRemoteSupportSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticSettingsGetDiagnosticRemoteSupportSettings_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway 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.DataBoxEdge.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 DiagnosticSettingsGetDiagnosticRemoteSupportSettingsViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/diagnosticRemoteSupportSettings/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticRemoteSupportSettings/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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/diagnosticRemoteSupportSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticSettingsGetDiagnosticRemoteSupportSettings_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.DataBoxEdge.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 DiagnosticSettingsGetDiagnosticRemoteSupportSettings_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DiagnosticRemoteSupportSettings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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 DiagnosticSettingsGetDiagnosticRemoteSupportSettings_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// + /// Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device. + /// + /// The device name. + /// The subscription ID. + /// The resource group name. + /// The proactive log collection 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.DataBoxEdge.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 DiagnosticSettingsUpdateDiagnosticProactiveLogCollectionSettings(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/diagnosticProactiveLogCollectionSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticSettingsUpdateDiagnosticProactiveLogCollectionSettings_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The proactive log collection 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.DataBoxEdge.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 DiagnosticSettingsUpdateDiagnosticProactiveLogCollectionSettingsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/diagnosticProactiveLogCollectionSettings/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticProactiveLogCollectionSettings/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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/diagnosticProactiveLogCollectionSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticSettingsUpdateDiagnosticProactiveLogCollectionSettings_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.DataBoxEdge.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 DiagnosticSettingsUpdateDiagnosticProactiveLogCollectionSettings_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DiagnosticProactiveLogCollectionSettings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 proactive log collection 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 DiagnosticSettingsUpdateDiagnosticProactiveLogCollectionSettings_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device. + /// + /// The device name. + /// The subscription ID. + /// The resource group name. + /// The diagnostic remote support 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.DataBoxEdge.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 DiagnosticSettingsUpdateDiagnosticRemoteSupportSettings(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/diagnosticRemoteSupportSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticSettingsUpdateDiagnosticRemoteSupportSettings_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The diagnostic remote support 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.DataBoxEdge.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 DiagnosticSettingsUpdateDiagnosticRemoteSupportSettingsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/diagnosticRemoteSupportSettings/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticRemoteSupportSettings/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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/diagnosticRemoteSupportSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticSettingsUpdateDiagnosticRemoteSupportSettings_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.DataBoxEdge.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 DiagnosticSettingsUpdateDiagnosticRemoteSupportSettings_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DiagnosticRemoteSupportSettings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 diagnostic remote support 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 DiagnosticSettingsUpdateDiagnosticRemoteSupportSettings_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + /// The device name. + /// The job name. + /// 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.DataBoxEdge.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 name, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/jobs/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the details of a specified job on a Data Box Edge/Data Box Gateway 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.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/jobs/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/jobs/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Job.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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 name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Creates a new metric configuration or updates an existing one for a role. + /// The device name. + /// The role name. + /// The subscription ID. + /// The resource group name. + /// The metric configuration. + /// 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.DataBoxEdge.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 MonitoringConfigCreateOrUpdate(string deviceName, string roleName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/roles/" + + global::System.Uri.EscapeDataString(roleName) + + "/monitoringConfig/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitoringConfigCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates a new metric configuration or updates an existing one for a role. + /// + /// The metric configuration. + /// 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.DataBoxEdge.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 MonitoringConfigCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/roles/(?[^/]+)/monitoringConfig/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var roleName = _match.Groups["roleName"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/roles/" + + roleName + + "/monitoringConfig/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitoringConfigCreateOrUpdate_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.DataBoxEdge.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 MonitoringConfigCreateOrUpdate_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MonitoringMetricConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 role name. + /// The subscription ID. + /// The resource group name. + /// The metric configuration. + /// 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 MonitoringConfigCreateOrUpdate_Validate(string deviceName, string roleName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(roleName),roleName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// deletes a new metric configuration for a role. + /// The device name. + /// The role name. + /// 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 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.DataBoxEdge.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 MonitoringConfigDelete(string deviceName, string roleName, string subscriptionId, string resourceGroupName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/roles/" + + global::System.Uri.EscapeDataString(roleName) + + "/monitoringConfig/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitoringConfigDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// deletes a new metric configuration for a role. + /// + /// 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.DataBoxEdge.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 MonitoringConfigDeleteViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/roles/(?[^/]+)/monitoringConfig/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var roleName = _match.Groups["roleName"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/roles/" + + roleName + + "/monitoringConfig/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitoringConfigDelete_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.DataBoxEdge.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 MonitoringConfigDelete_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 role name. + /// 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 MonitoringConfigDelete_Validate(string deviceName, string roleName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(roleName),roleName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Gets a metric configuration of a role. + /// The device name. + /// The role name. + /// 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.DataBoxEdge.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 MonitoringConfigGet(string deviceName, string roleName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/roles/" + + global::System.Uri.EscapeDataString(roleName) + + "/monitoringConfig/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitoringConfigGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a metric configuration of a role. + /// + /// 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.DataBoxEdge.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 MonitoringConfigGetViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/roles/(?[^/]+)/monitoringConfig/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var roleName = _match.Groups["roleName"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/roles/" + + roleName + + "/monitoringConfig/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitoringConfigGet_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.DataBoxEdge.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 MonitoringConfigGet_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MonitoringMetricConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 role name. + /// 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 MonitoringConfigGet_Validate(string deviceName, string roleName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(roleName),roleName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Lists metric configurations in a role. + /// The device name. + /// The role name. + /// 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.DataBoxEdge.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 MonitoringConfigList(string deviceName, string roleName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/roles/" + + global::System.Uri.EscapeDataString(roleName) + + "/monitoringConfig" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitoringConfigList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists metric configurations in a role. + /// + /// 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.DataBoxEdge.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 MonitoringConfigListViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/roles/(?[^/]+)/monitoringConfig$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var roleName = _match.Groups["roleName"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/roles/" + + roleName + + "/monitoringConfig" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MonitoringConfigList_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.DataBoxEdge.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 MonitoringConfigList_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MonitoringMetricConfigurationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 role name. + /// 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 MonitoringConfigList_Validate(string deviceName, string roleName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(roleName),roleName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Gets all the nodes currently configured under this Data Box Edge device + /// The device name. + /// 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.DataBoxEdge.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 NodesListByDataBoxEdgeDevice(string deviceName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/nodes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NodesListByDataBoxEdgeDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets all the nodes currently configured under this Data Box Edge 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.DataBoxEdge.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 NodesListByDataBoxEdgeDeviceViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/nodes$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes'"); + } + + // 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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/nodes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NodesListByDataBoxEdgeDevice_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.DataBoxEdge.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 NodesListByDataBoxEdgeDevice_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodeList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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 NodesListByDataBoxEdgeDevice_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// List all the supported operations. + /// 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.DataBoxEdge.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 OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.DataBoxEdge/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all the supported operations. + /// + /// 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.DataBoxEdge.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 OperationsListViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.DataBoxEdge/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.DataBoxEdge/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList_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.DataBoxEdge.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 OperationsList_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OperationsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + + } + } + + /// Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + /// The device name. + /// The job name. + /// 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.DataBoxEdge.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 OperationsStatusGet(string deviceName, string name, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/operationsStatus/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsStatusGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the details of a specified job on a Data Box Edge/Data Box Gateway 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.DataBoxEdge.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 OperationsStatusGetViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/operationsStatus/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/operationsStatus/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/operationsStatus/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsStatusGet_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.DataBoxEdge.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 OperationsStatusGet_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Job.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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 OperationsStatusGet_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Creates or updates an order. + /// The order details of a device. + /// The subscription ID. + /// The resource group name. + /// The order to be created 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.DataBoxEdge.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 OrdersCreateOrUpdate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/orders/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrdersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or updates an order. + /// + /// The order to be created 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.DataBoxEdge.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 OrdersCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/orders/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/orders/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrdersCreateOrUpdate_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.DataBoxEdge.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 OrdersCreateOrUpdate_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Order.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 order details of a device. + /// The subscription ID. + /// The resource group name. + /// The order to be created 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 OrdersCreateOrUpdate_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the order related to the device. + /// The device name. + /// 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 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.DataBoxEdge.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 OrdersDelete(string deviceName, string subscriptionId, string resourceGroupName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/orders/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrdersDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the order 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 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.DataBoxEdge.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 OrdersDeleteViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/orders/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/orders/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrdersDelete_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.DataBoxEdge.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 OrdersDelete_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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 OrdersDelete_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Gets a specific order by name. + /// The device name. + /// 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.DataBoxEdge.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 OrdersGet(string deviceName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/orders/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrdersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a specific order by 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.DataBoxEdge.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 OrdersGetViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/orders/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/orders/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrdersGet_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.DataBoxEdge.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 OrdersGet_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Order.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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 OrdersGet_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Lists all the orders related to a Data Box Edge/Data Box Gateway device. + /// The device name. + /// 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.DataBoxEdge.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 OrdersListByDataBoxEdgeDevice(string deviceName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/orders" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrdersListByDataBoxEdgeDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all the orders related to a Data Box Edge/Data Box Gateway 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.DataBoxEdge.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 OrdersListByDataBoxEdgeDeviceViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/orders$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders'"); + } + + // 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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/orders" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrdersListByDataBoxEdgeDevice_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.DataBoxEdge.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 OrdersListByDataBoxEdgeDevice_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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 OrdersListByDataBoxEdgeDevice_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Gets the DCAccess Code + /// The device name + /// 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.DataBoxEdge.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 OrdersListDcAccessCode(string deviceName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/orders/default/listDCAccessCode" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrdersListDcAccessCode_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the DCAccess Code + /// + /// 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.DataBoxEdge.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 OrdersListDcAccessCodeViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/orders/default/listDCAccessCode$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default/listDCAccessCode'"); + } + + // 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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/orders/default/listDCAccessCode" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrdersListDcAccessCode_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.DataBoxEdge.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 OrdersListDcAccessCode_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DcAccessCode.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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 OrdersListDcAccessCode_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Create or update a role. + /// The device name. + /// The role name. + /// The subscription ID. + /// The resource group name. + /// The role properties. + /// 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.DataBoxEdge.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 RolesCreateOrUpdate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/roles/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RolesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Create or update a role. + /// + /// The role properties. + /// 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.DataBoxEdge.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 RolesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/roles/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/roles/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RolesCreateOrUpdate_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.DataBoxEdge.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 RolesCreateOrUpdate_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Role.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 role name. + /// The subscription ID. + /// The resource group name. + /// The role properties. + /// 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 RolesCreateOrUpdate_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the role on the device. + /// The device name. + /// The role name. + /// 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 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.DataBoxEdge.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 RolesDelete(string deviceName, string name, string subscriptionId, string resourceGroupName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/roles/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RolesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the role on the device. + /// + /// 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.DataBoxEdge.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 RolesDeleteViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/roles/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/roles/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RolesDelete_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.DataBoxEdge.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 RolesDelete_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 role name. + /// 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 RolesDelete_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Gets a specific role by name. + /// The device name. + /// The role name. + /// 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.DataBoxEdge.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 RolesGet(string deviceName, string name, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/roles/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RolesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a specific role by 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.DataBoxEdge.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 RolesGetViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/roles/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/roles/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RolesGet_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.DataBoxEdge.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 RolesGet_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Role.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 role name. + /// 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 RolesGet_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + /// The device name. + /// 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.DataBoxEdge.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 RolesListByDataBoxEdgeDevice(string deviceName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/roles" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RolesListByDataBoxEdgeDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all the roles configured in a Data Box Edge/Data Box Gateway 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.DataBoxEdge.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 RolesListByDataBoxEdgeDeviceViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/roles$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles'"); + } + + // 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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/roles" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RolesListByDataBoxEdgeDevice_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.DataBoxEdge.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 RolesListByDataBoxEdgeDevice_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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 RolesListByDataBoxEdgeDevice_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Creates a new share or updates an existing share on the device. + /// The device name. + /// The share name. + /// The subscription ID. + /// The resource group name. + /// The share properties. + /// 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.DataBoxEdge.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 SharesCreateOrUpdate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/shares/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SharesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates a new share or updates an existing share on the device. + /// + /// The share properties. + /// 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.DataBoxEdge.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 SharesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/shares/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SharesCreateOrUpdate_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.DataBoxEdge.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 SharesCreateOrUpdate_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Share.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 share name. + /// The subscription ID. + /// The resource group name. + /// The share properties. + /// 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 SharesCreateOrUpdate_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the share on the Data Box Edge/Data Box Gateway device. + /// The device name. + /// The share name. + /// 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 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.DataBoxEdge.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 SharesDelete(string deviceName, string name, string subscriptionId, string resourceGroupName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/shares/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SharesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the share on the Data Box Edge/Data Box Gateway device. + /// + /// 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.DataBoxEdge.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 SharesDeleteViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/shares/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SharesDelete_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.DataBoxEdge.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 SharesDelete_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 share name. + /// 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 SharesDelete_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Gets a share by name. + /// The device name. + /// The share name. + /// 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.DataBoxEdge.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 SharesGet(string deviceName, string name, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/shares/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SharesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a share by 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.DataBoxEdge.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 SharesGetViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/shares/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SharesGet_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.DataBoxEdge.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 SharesGet_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Share.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 share name. + /// 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 SharesGet_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Lists all the shares in a Data Box Edge/Data Box Gateway device. + /// The device name. + /// 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.DataBoxEdge.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 SharesListByDataBoxEdgeDevice(string deviceName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/shares" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SharesListByDataBoxEdgeDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all the shares in a Data Box Edge/Data Box Gateway 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.DataBoxEdge.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 SharesListByDataBoxEdgeDeviceViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/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.DataBoxEdge/dataBoxEdgeDevices/{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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/shares" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SharesListByDataBoxEdgeDevice_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.DataBoxEdge.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 SharesListByDataBoxEdgeDevice_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ShareList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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 SharesListByDataBoxEdgeDevice_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Refreshes the share metadata with the data from the cloud. + /// The device name. + /// The share name. + /// 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.DataBoxEdge.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 SharesRefresh(string deviceName, string name, string subscriptionId, string resourceGroupName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/shares/" + + global::System.Uri.EscapeDataString(name) + + "/refresh" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SharesRefresh_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Refreshes the share metadata with the data from the cloud. + /// + /// 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.DataBoxEdge.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 SharesRefreshViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/shares/(?[^/]+)/refresh$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}/refresh'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/shares/" + + name + + "/refresh" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SharesRefresh_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.DataBoxEdge.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 SharesRefresh_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 share name. + /// 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 SharesRefresh_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Creates or updates the storage account credential. + /// The device name. + /// The storage account credential name. + /// The subscription ID. + /// The resource group name. + /// The storage account credential. + /// 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.DataBoxEdge.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 deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/storageAccountCredentials/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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. + /// 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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IStorageAccountCredential body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/storageAccountCredentials/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 storage account credential name. + /// The subscription ID. + /// The resource group name. + /// The storage account credential. + /// 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 deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the storage account credential. + /// The device name. + /// The storage account credential name. + /// 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 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.DataBoxEdge.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 deviceName, string name, string subscriptionId, string resourceGroupName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/storageAccountCredentials/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountCredentialsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the storage account credential. + /// + /// 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.DataBoxEdge.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 onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/storageAccountCredentials/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountCredentialsDelete_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.DataBoxEdge.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 onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 storage account credential name. + /// 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 StorageAccountCredentialsDelete_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Gets the properties of the specified storage account credential. + /// The device name. + /// The storage account credential name. + /// 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.DataBoxEdge.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 deviceName, string name, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/storageAccountCredentials/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountCredentialsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the properties of the specified storage account credential. + /// + /// 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.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/storageAccountCredentials/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 storage account credential name. + /// 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 StorageAccountCredentialsGet_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// + /// Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + /// + /// The device name. + /// 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.DataBoxEdge.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 StorageAccountCredentialsListByDataBoxEdgeDevice(string deviceName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/storageAccountCredentials" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountCredentialsListByDataBoxEdgeDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets all the storage account credentials in a Data Box Edge/Data Box Gateway 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.DataBoxEdge.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 StorageAccountCredentialsListByDataBoxEdgeDeviceViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials'"); + } + + // 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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/storageAccountCredentials" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountCredentialsListByDataBoxEdgeDevice_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.DataBoxEdge.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 StorageAccountCredentialsListByDataBoxEdgeDevice_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountCredentialList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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 StorageAccountCredentialsListByDataBoxEdgeDevice_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// + /// Creates a new StorageAccount or updates an existing StorageAccount on the device. + /// + /// The device name. + /// The StorageAccount name. + /// The subscription ID. + /// The resource group name. + /// The StorageAccount properties. + /// 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.DataBoxEdge.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 StorageAccountsCreateOrUpdate(string deviceName, string storageAccountName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/storageAccounts/" + + global::System.Uri.EscapeDataString(storageAccountName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Creates a new StorageAccount or updates an existing StorageAccount on the device. + /// + /// + /// The StorageAccount properties. + /// 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.DataBoxEdge.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 StorageAccountsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/storageAccounts/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var storageAccountName = _match.Groups["storageAccountName"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/storageAccounts/" + + storageAccountName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsCreateOrUpdate_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.DataBoxEdge.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 StorageAccountsCreateOrUpdate_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccount.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 StorageAccount name. + /// The subscription ID. + /// The resource group name. + /// The StorageAccount properties. + /// 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 StorageAccountsCreateOrUpdate_Validate(string deviceName, string storageAccountName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(storageAccountName),storageAccountName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + /// The device name. + /// The StorageAccount name. + /// The subscription ID. + /// The resource group 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.DataBoxEdge.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 StorageAccountsDelete(string deviceName, string storageAccountName, string subscriptionId, string resourceGroupName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/storageAccounts/" + + global::System.Uri.EscapeDataString(storageAccountName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the StorageAccount on the Data Box Edge/Data Box Gateway 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.DataBoxEdge.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 StorageAccountsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/storageAccounts/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var storageAccountName = _match.Groups["storageAccountName"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/storageAccounts/" + + storageAccountName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsDelete_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.DataBoxEdge.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 StorageAccountsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 StorageAccount name. + /// 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 StorageAccountsDelete_Validate(string deviceName, string storageAccountName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(storageAccountName),storageAccountName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Gets a StorageAccount by name. + /// The device name. + /// The storage account name. + /// 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.DataBoxEdge.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 StorageAccountsGet(string deviceName, string storageAccountName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/storageAccounts/" + + global::System.Uri.EscapeDataString(storageAccountName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a StorageAccount by 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.DataBoxEdge.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 StorageAccountsGetViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/storageAccounts/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var storageAccountName = _match.Groups["storageAccountName"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/storageAccounts/" + + storageAccountName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsGet_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.DataBoxEdge.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 StorageAccountsGet_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccount.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 storage account name. + /// 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 StorageAccountsGet_Validate(string deviceName, string storageAccountName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(storageAccountName),storageAccountName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + /// The device name. + /// 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.DataBoxEdge.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 StorageAccountsListByDataBoxEdgeDevice(string deviceName, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/storageAccounts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsListByDataBoxEdgeDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway 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.DataBoxEdge.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 StorageAccountsListByDataBoxEdgeDeviceViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/storageAccounts$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts'"); + } + + // 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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/storageAccounts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsListByDataBoxEdgeDevice_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.DataBoxEdge.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 StorageAccountsListByDataBoxEdgeDevice_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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 StorageAccountsListByDataBoxEdgeDevice_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Triggers support package on the device + /// The device name. + /// The subscription ID. + /// The resource group name. + /// The trigger support package request object + /// 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.DataBoxEdge.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 SupportPackagesTriggerSupportPackage(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/triggerSupportPackage" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SupportPackagesTriggerSupportPackage_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Triggers support package on the device + /// + /// The trigger support package request object + /// 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.DataBoxEdge.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 SupportPackagesTriggerSupportPackageViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/triggerSupportPackage$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggerSupportPackage'"); + } + + // 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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/triggerSupportPackage" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SupportPackagesTriggerSupportPackage_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.DataBoxEdge.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 SupportPackagesTriggerSupportPackage_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 trigger support package request object + /// 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 SupportPackagesTriggerSupportPackage_Validate(string deviceName, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates or updates a trigger. + /// Creates or updates a trigger + /// The trigger name. + /// The subscription ID. + /// The resource group name. + /// The trigger. + /// 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.DataBoxEdge.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 TriggersCreateOrUpdate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/triggers/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TriggersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or updates a trigger. + /// + /// The trigger. + /// 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.DataBoxEdge.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 TriggersCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/triggers/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/triggers/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TriggersCreateOrUpdate_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.DataBoxEdge.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 TriggersCreateOrUpdate_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Trigger.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// + /// Creates or updates a trigger + /// The trigger name. + /// The subscription ID. + /// The resource group name. + /// The trigger. + /// 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 TriggersCreateOrUpdate_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the trigger on the gateway device. + /// The device name. + /// The trigger name. + /// 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 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.DataBoxEdge.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 TriggersDelete(string deviceName, string name, string subscriptionId, string resourceGroupName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/triggers/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TriggersDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the trigger on the gateway device. + /// + /// 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.DataBoxEdge.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 TriggersDeleteViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/triggers/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/triggers/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TriggersDelete_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.DataBoxEdge.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 TriggersDelete_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 trigger name. + /// 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 TriggersDelete_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Get a specific trigger by name. + /// The device name. + /// The trigger name. + /// 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.DataBoxEdge.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 TriggersGet(string deviceName, string name, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/triggers/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TriggersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get a specific trigger by 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.DataBoxEdge.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 TriggersGetViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/triggers/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/triggers/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TriggersGet_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.DataBoxEdge.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 TriggersGet_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Trigger.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 trigger name. + /// 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 TriggersGet_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Lists all the triggers configured in the device. + /// The device name. + /// The subscription ID. + /// The resource group name. + /// Specify $filter='CustomContextTag eq ' to filter on custom context tag property + /// 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.DataBoxEdge.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 TriggersListByDataBoxEdgeDevice(string deviceName, string subscriptionId, string resourceGroupName, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/triggers" + + "?" + + "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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TriggersListByDataBoxEdgeDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all the triggers configured in the device. + /// + /// Specify $filter='CustomContextTag eq ' to filter on custom context tag property + /// 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.DataBoxEdge.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 TriggersListByDataBoxEdgeDeviceViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/triggers$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers'"); + } + + // 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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/triggers" + + "?" + + "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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TriggersListByDataBoxEdgeDevice_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.DataBoxEdge.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 TriggersListByDataBoxEdgeDevice_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TriggerList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// Specify $filter='CustomContextTag eq ' to filter on custom context tag property + /// 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 TriggersListByDataBoxEdgeDevice_Validate(string deviceName, string subscriptionId, string resourceGroupName, string Filter, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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(Filter),Filter); + } + } + + /// + /// Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + /// + /// The device name. + /// The user name. + /// The subscription ID. + /// The resource group name. + /// The user details. + /// 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.DataBoxEdge.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 UsersCreateOrUpdate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/users/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The user details. + /// 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.DataBoxEdge.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 UsersCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/users/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/users/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsersCreateOrUpdate_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.DataBoxEdge.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 UsersCreateOrUpdate_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.User.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// The subscription ID. + /// The resource group name. + /// The user details. + /// 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 UsersCreateOrUpdate_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser body, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the user on a databox edge/gateway device. + /// The device name. + /// The user name. + /// 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 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.DataBoxEdge.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 UsersDelete(string deviceName, string name, string subscriptionId, string resourceGroupName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/users/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsersDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the user on a databox edge/gateway device. + /// + /// 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.DataBoxEdge.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 UsersDeleteViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/users/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/users/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsersDelete_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.DataBoxEdge.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 UsersDelete_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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 UsersDelete_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Gets the properties of the specified user. + /// The device name. + /// The user name. + /// 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.DataBoxEdge.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 UsersGet(string deviceName, string name, 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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/users/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the properties of the specified user. + /// + /// 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.DataBoxEdge.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 UsersGetViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/users/(?[^/]+)$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var name = _match.Groups["name"].Value; + 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.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/users/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsersGet_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.DataBoxEdge.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 UsersGet_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.User.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// 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 UsersGet_Validate(string deviceName, string name, string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Gets all the users registered on a Data Box Edge/Data Box Gateway device. + /// The device name. + /// The subscription ID. + /// The resource group name. + /// Specify $filter='Type eq ' to filter on user type property + /// 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.DataBoxEdge.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 UsersListByDataBoxEdgeDevice(string deviceName, string subscriptionId, string resourceGroupName, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/users" + + "?" + + "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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsersListByDataBoxEdgeDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets all the users registered on a Data Box Edge/Data Box Gateway device. + /// + /// Specify $filter='Type eq ' to filter on user type property + /// 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.DataBoxEdge.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 UsersListByDataBoxEdgeDeviceViaIdentity(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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-03-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.DataBoxEdge/dataBoxEdgeDevices/(?[^/]+)/users$", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users'"); + } + + // 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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/" + + deviceName + + "/users" + + "?" + + "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.DataBoxEdge.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.DataBoxEdge.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsersListByDataBoxEdgeDevice_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.DataBoxEdge.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 UsersListByDataBoxEdgeDevice_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.DataBoxEdge.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UserList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// Specify $filter='Type eq ' to filter on user type property + /// 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 UsersListByDataBoxEdgeDevice_Validate(string deviceName, string subscriptionId, string resourceGroupName, string Filter, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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(Filter),Filter); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20/SystemData.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20/SystemData.PowerShell.cs new file mode 100644 index 000000000000..cf90ebc07c7e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20/SystemData.PowerShell.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.DataBoxEdge.Models.Api20 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Metadata pertaining to creation and last modification of the resource. + [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))] + public partial class SystemData + { + + /// + /// 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.DataBoxEdge.Models.Api20.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SystemData(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.DataBoxEdge.Models.Api20.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SystemData(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.DataBoxEdge.Models.Api20.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SystemData(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + } + if (content.Contains("CreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("CreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("LastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).LastModifiedAt, (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 SystemData(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + } + if (content.Contains("CreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("CreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("LastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)this).LastModifiedAt, (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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Metadata pertaining to creation and last modification of the resource. + [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))] + public partial interface ISystemData + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20/SystemData.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20/SystemData.TypeConverter.cs new file mode 100644 index 000000000000..2393a2b41768 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20/SystemData.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.DataBoxEdge.Models.Api20 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SystemDataTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20.ISystemData ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SystemData.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SystemData.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SystemData.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/databoxedge/generated/api/Models/Api20/SystemData.cs b/swaggerci/databoxedge/generated/api/Models/Api20/SystemData.cs new file mode 100644 index 000000000000..12042c87631a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20/SystemData.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.DataBoxEdge.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Metadata pertaining to creation and last modification of the resource. + public partial class SystemData : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal + { + + /// Backing field for property. + private global::System.DateTime? _createdAt; + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? CreatedAt { get => this._createdAt; set => this._createdAt = value; } + + /// Backing field for property. + private string _createdBy; + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string CreatedBy { get => this._createdBy; set => this._createdBy = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? _createdByType; + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? CreatedByType { get => this._createdByType; set => this._createdByType = value; } + + /// Backing field for property. + private global::System.DateTime? _lastModifiedAt; + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? LastModifiedAt { get => this._lastModifiedAt; set => this._lastModifiedAt = value; } + + /// Backing field for property. + private string _lastModifiedBy; + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string LastModifiedBy { get => this._lastModifiedBy; set => this._lastModifiedBy = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? _lastModifiedByType; + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } + + /// Creates an new instance. + public SystemData() + { + + } + } + /// Metadata pertaining to creation and last modification of the resource. + public partial interface ISystemData : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string CreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? CreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string LastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? LastModifiedByType { get; set; } + + } + /// Metadata pertaining to creation and last modification of the resource. + internal partial interface ISystemDataInternal + + { + /// The timestamp of resource creation (UTC). + global::System.DateTime? CreatedAt { get; set; } + /// The identity that created the resource. + string CreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? CreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? LastModifiedAt { get; set; } + /// The identity that last modified the resource. + string LastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? LastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20/SystemData.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20/SystemData.json.cs new file mode 100644 index 000000000000..499ba5acf2be --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20/SystemData.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.DataBoxEdge.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Metadata pertaining to creation and last modification of the resource. + public partial class SystemData + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new SystemData(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)CreatedBy;} + {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)CreatedByType;} + {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : CreatedAt : CreatedAt;} + {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)LastModifiedBy;} + {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)LastModifiedByType;} + {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : LastModifiedAt : LastModifiedAt;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._createdBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy" ,container.Add ); + AddIf( null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType" ,container.Add ); + AddIf( null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._createdAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdAt" ,container.Add ); + AddIf( null != (((object)this._lastModifiedBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy" ,container.Add ); + AddIf( null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType" ,container.Add ); + AddIf( null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._lastModifiedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedAt" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Addon.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Addon.PowerShell.cs new file mode 100644 index 000000000000..9cfbb896b1d2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Addon.PowerShell.cs @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Role Addon + [System.ComponentModel.TypeConverter(typeof(AddonTypeConverter))] + public partial class Addon + { + + /// + /// 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 Addon(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedAt, (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 Addon(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedAt, (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.DataBoxEdge.Models.Api20220301.IAddon DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Addon(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.DataBoxEdge.Models.Api20220301.IAddon DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Addon(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.DataBoxEdge.Models.Api20220301.IAddon FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Role Addon + [System.ComponentModel.TypeConverter(typeof(AddonTypeConverter))] + public partial interface IAddon + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Addon.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Addon.TypeConverter.cs new file mode 100644 index 000000000000..ca4a98312330 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Addon.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AddonTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IAddon ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Addon.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Addon.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Addon.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/databoxedge/generated/api/Models/Api20220301/Addon.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Addon.cs new file mode 100644 index 000000000000..ab00cc2501e2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Addon.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Role Addon + public partial class Addon : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType _kind; + + /// Addon type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType Kind { get => this._kind; set => this._kind = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of Addon + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Creates an new instance. + public Addon() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// Role Addon + public partial interface IAddon : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// Addon type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Addon type.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType Kind { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// Role Addon + internal partial interface IAddonInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// Addon type. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType Kind { get; set; } + /// Metadata pertaining to creation and last modification of Addon + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Addon.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Addon.json.cs new file mode 100644 index 000000000000..42f8543ce40b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Addon.json.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Role Addon + public partial class Addon + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal Addon(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon interface is polymorphic, and the precise + /// model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("kind") ) + { + case "ArcForKubernetes": + { + return new ArcAddon(json); + } + case "IotEdge": + { + return new IoTAddon(json); + } + } + return new Addon(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/AddonList.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AddonList.PowerShell.cs new file mode 100644 index 000000000000..8f9f3602a26d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AddonList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Collection of all the Role addon on the Azure Stack Edge device. + [System.ComponentModel.TypeConverter(typeof(AddonListTypeConverter))] + public partial class AddonList + { + + /// + /// 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 AddonList(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.DataBoxEdge.Models.Api20220301.IAddonListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AddonTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonListInternal)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 AddonList(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.DataBoxEdge.Models.Api20220301.IAddonListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AddonTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonListInternal)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.DataBoxEdge.Models.Api20220301.IAddonList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AddonList(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.DataBoxEdge.Models.Api20220301.IAddonList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AddonList(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.DataBoxEdge.Models.Api20220301.IAddonList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of all the Role addon on the Azure Stack Edge device. + [System.ComponentModel.TypeConverter(typeof(AddonListTypeConverter))] + public partial interface IAddonList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/AddonList.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AddonList.TypeConverter.cs new file mode 100644 index 000000000000..9f11e86ebe62 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AddonList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AddonListTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IAddonList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AddonList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AddonList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AddonList.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/databoxedge/generated/api/Models/Api20220301/AddonList.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AddonList.cs new file mode 100644 index 000000000000..70ec1a6d70ce --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AddonList.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Collection of all the Role addon on the Azure Stack Edge device. + public partial class AddonList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonList, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonListInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon[] _value; + + /// The Value. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon[] Value { get => this._value; } + + /// Creates an new instance. + public AddonList() + { + + } + } + /// Collection of all the Role addon on the Azure Stack Edge device. + public partial interface IAddonList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Link to the next set of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The Value. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon[] Value { get; } + + } + /// Collection of all the Role addon on the Azure Stack Edge device. + internal partial interface IAddonListInternal + + { + /// Link to the next set of results. + string NextLink { get; set; } + /// The Value. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/AddonList.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AddonList.json.cs new file mode 100644 index 000000000000..e02c78cb0de2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AddonList.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Collection of all the Role addon on the Azure Stack Edge device. + public partial class AddonList + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal AddonList(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IAddon) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Addon.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.DataBoxEdge.Models.Api20220301.IAddonList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new AddonList(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/Address.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Address.PowerShell.cs new file mode 100644 index 000000000000..09c6431be559 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Address.PowerShell.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The shipping address of the customer. + [System.ComponentModel.TypeConverter(typeof(AddressTypeConverter))] + public partial class Address + { + + /// + /// 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 Address(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Line1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).Line1 = (string) content.GetValueForProperty("Line1",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).Line1, global::System.Convert.ToString); + } + if (content.Contains("Line2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).Line2 = (string) content.GetValueForProperty("Line2",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).Line2, global::System.Convert.ToString); + } + if (content.Contains("Line3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).Line3 = (string) content.GetValueForProperty("Line3",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).Line3, global::System.Convert.ToString); + } + if (content.Contains("PostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).PostalCode = (string) content.GetValueForProperty("PostalCode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).PostalCode, global::System.Convert.ToString); + } + if (content.Contains("City")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).City = (string) content.GetValueForProperty("City",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).City, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).State, global::System.Convert.ToString); + } + if (content.Contains("Country")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).Country = (string) content.GetValueForProperty("Country",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).Country, 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 Address(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Line1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).Line1 = (string) content.GetValueForProperty("Line1",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).Line1, global::System.Convert.ToString); + } + if (content.Contains("Line2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).Line2 = (string) content.GetValueForProperty("Line2",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).Line2, global::System.Convert.ToString); + } + if (content.Contains("Line3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).Line3 = (string) content.GetValueForProperty("Line3",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).Line3, global::System.Convert.ToString); + } + if (content.Contains("PostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).PostalCode = (string) content.GetValueForProperty("PostalCode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).PostalCode, global::System.Convert.ToString); + } + if (content.Contains("City")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).City = (string) content.GetValueForProperty("City",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).City, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).State, global::System.Convert.ToString); + } + if (content.Contains("Country")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).Country = (string) content.GetValueForProperty("Country",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)this).Country, 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.DataBoxEdge.Models.Api20220301.IAddress DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Address(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.DataBoxEdge.Models.Api20220301.IAddress DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Address(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.DataBoxEdge.Models.Api20220301.IAddress FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The shipping address of the customer. + [System.ComponentModel.TypeConverter(typeof(AddressTypeConverter))] + public partial interface IAddress + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Address.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Address.TypeConverter.cs new file mode 100644 index 000000000000..6084cfa13168 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Address.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AddressTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IAddress ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddress).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Address.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Address.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Address.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/databoxedge/generated/api/Models/Api20220301/Address.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Address.cs new file mode 100644 index 000000000000..20f21d4a1614 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Address.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The shipping address of the customer. + public partial class Address : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddress, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal + { + + /// Backing field for property. + private string _city; + + /// The city name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string City { get => this._city; set => this._city = value; } + + /// Backing field for property. + private string _country; + + /// The country name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Country { get => this._country; set => this._country = value; } + + /// Backing field for property. + private string _line1; + + /// The address line1. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Line1 { get => this._line1; set => this._line1 = value; } + + /// Backing field for property. + private string _line2; + + /// The address line2. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Line2 { get => this._line2; set => this._line2 = value; } + + /// Backing field for property. + private string _line3; + + /// The address line3. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Line3 { get => this._line3; set => this._line3 = value; } + + /// Backing field for property. + private string _postalCode; + + /// The postal code. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string PostalCode { get => this._postalCode; set => this._postalCode = value; } + + /// Backing field for property. + private string _state; + + /// The state name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string State { get => this._state; set => this._state = value; } + + /// Creates an new instance. + public Address() + { + + } + } + /// The shipping address of the customer. + public partial interface IAddress : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The city name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The city name.", + SerializedName = @"city", + PossibleTypes = new [] { typeof(string) })] + string City { get; set; } + /// The country name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The country name.", + SerializedName = @"country", + PossibleTypes = new [] { typeof(string) })] + string Country { get; set; } + /// The address line1. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The address line1.", + SerializedName = @"addressLine1", + PossibleTypes = new [] { typeof(string) })] + string Line1 { get; set; } + /// The address line2. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The address line2.", + SerializedName = @"addressLine2", + PossibleTypes = new [] { typeof(string) })] + string Line2 { get; set; } + /// The address line3. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The address line3.", + SerializedName = @"addressLine3", + PossibleTypes = new [] { typeof(string) })] + string Line3 { get; set; } + /// The postal code. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The postal code.", + SerializedName = @"postalCode", + PossibleTypes = new [] { typeof(string) })] + string PostalCode { get; set; } + /// The state name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The state name.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(string) })] + string State { get; set; } + + } + /// The shipping address of the customer. + internal partial interface IAddressInternal + + { + /// The city name. + string City { get; set; } + /// The country name. + string Country { get; set; } + /// The address line1. + string Line1 { get; set; } + /// The address line2. + string Line2 { get; set; } + /// The address line3. + string Line3 { get; set; } + /// The postal code. + string PostalCode { get; set; } + /// The state name. + string State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Address.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Address.json.cs new file mode 100644 index 000000000000..39456fc425d2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Address.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The shipping address of the customer. + public partial class Address + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal Address(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_line1 = If( json?.PropertyT("addressLine1"), out var __jsonAddressLine1) ? (string)__jsonAddressLine1 : (string)Line1;} + {_line2 = If( json?.PropertyT("addressLine2"), out var __jsonAddressLine2) ? (string)__jsonAddressLine2 : (string)Line2;} + {_line3 = If( json?.PropertyT("addressLine3"), out var __jsonAddressLine3) ? (string)__jsonAddressLine3 : (string)Line3;} + {_postalCode = If( json?.PropertyT("postalCode"), out var __jsonPostalCode) ? (string)__jsonPostalCode : (string)PostalCode;} + {_city = If( json?.PropertyT("city"), out var __jsonCity) ? (string)__jsonCity : (string)City;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_country = If( json?.PropertyT("country"), out var __jsonCountry) ? (string)__jsonCountry : (string)Country;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddress. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddress. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddress FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new Address(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._line1)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._line1.ToString()) : null, "addressLine1" ,container.Add ); + AddIf( null != (((object)this._line2)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._line2.ToString()) : null, "addressLine2" ,container.Add ); + AddIf( null != (((object)this._line3)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._line3.ToString()) : null, "addressLine3" ,container.Add ); + AddIf( null != (((object)this._postalCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._postalCode.ToString()) : null, "postalCode" ,container.Add ); + AddIf( null != (((object)this._city)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._city.ToString()) : null, "city" ,container.Add ); + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + AddIf( null != (((object)this._country)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._country.ToString()) : null, "country" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Alert.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Alert.PowerShell.cs new file mode 100644 index 000000000000..c7e9b6815964 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Alert.PowerShell.cs @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Alert on the data box edge/gateway device. + [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.DataBoxEdge.Models.Api20220301.IAlertInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetails) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).ErrorDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Title")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).Title = (string) content.GetValueForProperty("Title",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).Title, global::System.Convert.ToString); + } + if (content.Contains("AlertType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).AlertType = (string) content.GetValueForProperty("AlertType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).AlertType, global::System.Convert.ToString); + } + if (content.Contains("AppearedAtDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).AppearedAtDateTime = (global::System.DateTime?) content.GetValueForProperty("AppearedAtDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).AppearedAtDateTime, (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.DataBoxEdge.Models.Api20220301.IAlertInternal)this).Recommendation = (string) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).Recommendation, global::System.Convert.ToString); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).Severity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).Severity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity.CreateFrom); + } + if (content.Contains("DetailedInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).DetailedInformation = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation) content.GetValueForProperty("DetailedInformation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).DetailedInformation, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertPropertiesDetailedInformationTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ErrorDetailErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).ErrorDetailErrorCode = (string) content.GetValueForProperty("ErrorDetailErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).ErrorDetailErrorCode, global::System.Convert.ToString); + } + if (content.Contains("ErrorDetailErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).ErrorDetailErrorMessage = (string) content.GetValueForProperty("ErrorDetailErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).ErrorDetailErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("ErrorDetailOccurrence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).ErrorDetailOccurrence = (int?) content.GetValueForProperty("ErrorDetailOccurrence",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).ErrorDetailOccurrence, (__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.DataBoxEdge.Models.Api20220301.IAlertInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetails) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).ErrorDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Title")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).Title = (string) content.GetValueForProperty("Title",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).Title, global::System.Convert.ToString); + } + if (content.Contains("AlertType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).AlertType = (string) content.GetValueForProperty("AlertType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).AlertType, global::System.Convert.ToString); + } + if (content.Contains("AppearedAtDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).AppearedAtDateTime = (global::System.DateTime?) content.GetValueForProperty("AppearedAtDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).AppearedAtDateTime, (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.DataBoxEdge.Models.Api20220301.IAlertInternal)this).Recommendation = (string) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).Recommendation, global::System.Convert.ToString); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).Severity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).Severity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity.CreateFrom); + } + if (content.Contains("DetailedInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).DetailedInformation = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation) content.GetValueForProperty("DetailedInformation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).DetailedInformation, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertPropertiesDetailedInformationTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ErrorDetailErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).ErrorDetailErrorCode = (string) content.GetValueForProperty("ErrorDetailErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).ErrorDetailErrorCode, global::System.Convert.ToString); + } + if (content.Contains("ErrorDetailErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).ErrorDetailErrorMessage = (string) content.GetValueForProperty("ErrorDetailErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).ErrorDetailErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("ErrorDetailOccurrence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).ErrorDetailOccurrence = (int?) content.GetValueForProperty("ErrorDetailOccurrence",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal)this).ErrorDetailOccurrence, (__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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IAlert FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Alert on the data box edge/gateway device. + [System.ComponentModel.TypeConverter(typeof(AlertTypeConverter))] + public partial interface IAlert + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Alert.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Alert.TypeConverter.cs new file mode 100644 index 000000000000..918a50d10aaf --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Alert.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IAlert ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/Alert.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Alert.cs new file mode 100644 index 000000000000..5cc43a929061 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Alert.cs @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Alert on the data box edge/gateway device. + public partial class Alert : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// Alert type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string AlertType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).AlertType; } + + /// UTC time when the alert appeared. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? AppearedAtDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).AppearedAtDateTime; } + + /// Alert details. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation DetailedInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).DetailedInformation; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ErrorDetailErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).ErrorDetailErrorCode; } + + /// Error Message. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ErrorDetailErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).ErrorDetailErrorMessage; } + + /// Number of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? ErrorDetailOccurrence { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).ErrorDetailOccurrence; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// Internal Acessors for AlertType + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal.AlertType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).AlertType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).AlertType = value; } + + /// Internal Acessors for AppearedAtDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal.AppearedAtDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).AppearedAtDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).AppearedAtDateTime = value; } + + /// Internal Acessors for DetailedInformation + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal.DetailedInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).DetailedInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).DetailedInformation = value; } + + /// Internal Acessors for ErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetails Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal.ErrorDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).ErrorDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).ErrorDetail = value; } + + /// Internal Acessors for ErrorDetailErrorCode + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal.ErrorDetailErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).ErrorDetailErrorCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).ErrorDetailErrorCode = value; } + + /// Internal Acessors for ErrorDetailErrorMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal.ErrorDetailErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).ErrorDetailErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).ErrorDetailErrorMessage = value; } + + /// Internal Acessors for ErrorDetailOccurrence + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal.ErrorDetailOccurrence { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).ErrorDetailOccurrence; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).ErrorDetailOccurrence = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertProperties()); set { {_property = value;} } } + + /// Internal Acessors for Recommendation + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal.Recommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).Recommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).Recommendation = value; } + + /// Internal Acessors for Severity + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal.Severity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).Severity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).Severity = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Title + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertInternal.Title { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).Title = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertProperties _property; + + /// Properties of alert. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertProperties()); } + + /// Alert recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Recommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).Recommendation; } + + /// Severity of the alert. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity? Severity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).Severity; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of Alert + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// Alert title. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Title { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)Property).Title; } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Creates an new instance. + public Alert() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// Alert on the data box edge/gateway device. + public partial interface IAlert : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// Alert type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Alert type.", + SerializedName = @"alertType", + PossibleTypes = new [] { typeof(string) })] + string AlertType { get; } + /// UTC time when the alert appeared. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"UTC time when the alert appeared.", + SerializedName = @"appearedAtDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? AppearedAtDateTime { get; } + /// Alert details. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Alert details.", + SerializedName = @"detailedInformation", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation DetailedInformation { get; } + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"errorCode", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailErrorCode { get; } + /// Error Message. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error Message.", + SerializedName = @"errorMessage", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailErrorMessage { get; } + /// Number of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of occurrences.", + SerializedName = @"occurrences", + PossibleTypes = new [] { typeof(int) })] + int? ErrorDetailOccurrence { get; } + /// Alert recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Alert recommendation.", + SerializedName = @"recommendation", + PossibleTypes = new [] { typeof(string) })] + string Recommendation { get; } + /// Severity of the alert. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Severity of the alert.", + SerializedName = @"severity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity? Severity { get; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Alert title. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Alert title.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; } + + } + /// Alert on the data box edge/gateway device. + internal partial interface IAlertInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// Alert type. + string AlertType { get; set; } + /// UTC time when the alert appeared. + global::System.DateTime? AppearedAtDateTime { get; set; } + /// Alert details. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation DetailedInformation { get; set; } + /// Error details of the alert. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetails ErrorDetail { get; set; } + /// Error code. + string ErrorDetailErrorCode { get; set; } + /// Error Message. + string ErrorDetailErrorMessage { get; set; } + /// Number of occurrences. + int? ErrorDetailOccurrence { get; set; } + /// Properties of alert. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertProperties Property { get; set; } + /// Alert recommendation. + string Recommendation { get; set; } + /// Severity of the alert. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity? Severity { get; set; } + /// Metadata pertaining to creation and last modification of Alert + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Alert title. + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Alert.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Alert.json.cs new file mode 100644 index 000000000000..1a60c4e9eb06 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Alert.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Alert on the data box edge/gateway device. + 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal Alert(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertErrorDetails.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertErrorDetails.PowerShell.cs new file mode 100644 index 000000000000..2fbd7f523343 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertErrorDetails.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)this).ErrorCode = (string) content.GetValueForProperty("ErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)this).ErrorCode, global::System.Convert.ToString); + } + if (content.Contains("ErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)this).ErrorMessage = (string) content.GetValueForProperty("ErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)this).ErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("Occurrence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)this).Occurrence = (int?) content.GetValueForProperty("Occurrence",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)this).Occurrence, (__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.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)this).ErrorCode = (string) content.GetValueForProperty("ErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)this).ErrorCode, global::System.Convert.ToString); + } + if (content.Contains("ErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)this).ErrorMessage = (string) content.GetValueForProperty("ErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)this).ErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("Occurrence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)this).Occurrence = (int?) content.GetValueForProperty("Occurrence",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)this).Occurrence, (__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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IAlertErrorDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/AlertErrorDetails.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertErrorDetails.TypeConverter.cs new file mode 100644 index 000000000000..308c63a8d971 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IAlertErrorDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/AlertErrorDetails.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertErrorDetails.cs new file mode 100644 index 000000000000..9c218d2f456f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertErrorDetails.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Error details for the alert. + public partial class AlertErrorDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetails, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal + { + + /// Backing field for property. + private string _errorCode; + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ErrorCode { get => this._errorCode; } + + /// Backing field for property. + private string _errorMessage; + + /// Error Message. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ErrorMessage { get => this._errorMessage; } + + /// Internal Acessors for ErrorCode + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal.ErrorCode { get => this._errorCode; set { {_errorCode = value;} } } + + /// Internal Acessors for ErrorMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal.ErrorMessage { get => this._errorMessage; set { {_errorMessage = value;} } } + + /// Internal Acessors for Occurrence + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal.Occurrence { get => this._occurrence; set { {_occurrence = value;} } } + + /// Backing field for property. + private int? _occurrence; + + /// Number of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? Occurrence { get => this._occurrence; } + + /// Creates an new instance. + public AlertErrorDetails() + { + + } + } + /// Error details for the alert. + public partial interface IAlertErrorDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"errorCode", + PossibleTypes = new [] { typeof(string) })] + string ErrorCode { get; } + /// Error Message. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error Message.", + SerializedName = @"errorMessage", + PossibleTypes = new [] { typeof(string) })] + string ErrorMessage { get; } + /// Number of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of occurrences.", + SerializedName = @"occurrences", + PossibleTypes = new [] { typeof(int) })] + int? Occurrence { get; } + + } + /// 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? Occurrence { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertErrorDetails.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertErrorDetails.json.cs new file mode 100644 index 000000000000..41f5045f7285 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertErrorDetails.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal AlertErrorDetails(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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;} + {_occurrence = If( json?.PropertyT("occurrences"), out var __jsonOccurrences) ? (int?)__jsonOccurrences : Occurrence;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._errorCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._errorCode.ToString()) : null, "errorCode" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._errorMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._errorMessage.ToString()) : null, "errorMessage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._occurrence ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._occurrence) : null, "occurrences" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertList.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertList.PowerShell.cs new file mode 100644 index 000000000000..78167fb90592 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IAlertListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IAlertListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IAlertList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/AlertList.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertList.TypeConverter.cs new file mode 100644 index 000000000000..77ec355bff12 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IAlertList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/AlertList.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertList.cs new file mode 100644 index 000000000000..6c866d5cf730 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertList.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Collection of alerts. + public partial class AlertList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertList, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertListInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert[] _value; + + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert[] Value { get => this._value; } + + /// Creates an new instance. + public AlertList() + { + + } + } + /// Collection of alerts. + public partial interface IAlertList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Link to the next set of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert[] Value { get; } + + } + /// Collection of alerts. + internal partial interface IAlertListInternal + + { + /// Link to the next set of results. + string NextLink { get; set; } + /// The value. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertList.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertList.json.cs new file mode 100644 index 000000000000..947ee491811f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertList.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal AlertList(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IAlert) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IAlertList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/AlertProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertProperties.PowerShell.cs new file mode 100644 index 000000000000..fbe1c2cba270 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertProperties.PowerShell.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetails) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).ErrorDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Title")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).Title = (string) content.GetValueForProperty("Title",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).Title, global::System.Convert.ToString); + } + if (content.Contains("AlertType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).AlertType = (string) content.GetValueForProperty("AlertType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).AlertType, global::System.Convert.ToString); + } + if (content.Contains("AppearedAtDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).AppearedAtDateTime = (global::System.DateTime?) content.GetValueForProperty("AppearedAtDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).AppearedAtDateTime, (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.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).Recommendation = (string) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).Recommendation, global::System.Convert.ToString); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).Severity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).Severity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity.CreateFrom); + } + if (content.Contains("DetailedInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).DetailedInformation = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation) content.GetValueForProperty("DetailedInformation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).DetailedInformation, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertPropertiesDetailedInformationTypeConverter.ConvertFrom); + } + if (content.Contains("ErrorDetailErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).ErrorDetailErrorCode = (string) content.GetValueForProperty("ErrorDetailErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).ErrorDetailErrorCode, global::System.Convert.ToString); + } + if (content.Contains("ErrorDetailErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).ErrorDetailErrorMessage = (string) content.GetValueForProperty("ErrorDetailErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).ErrorDetailErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("ErrorDetailOccurrence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).ErrorDetailOccurrence = (int?) content.GetValueForProperty("ErrorDetailOccurrence",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).ErrorDetailOccurrence, (__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("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetails) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).ErrorDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Title")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).Title = (string) content.GetValueForProperty("Title",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).Title, global::System.Convert.ToString); + } + if (content.Contains("AlertType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).AlertType = (string) content.GetValueForProperty("AlertType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).AlertType, global::System.Convert.ToString); + } + if (content.Contains("AppearedAtDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).AppearedAtDateTime = (global::System.DateTime?) content.GetValueForProperty("AppearedAtDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).AppearedAtDateTime, (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.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).Recommendation = (string) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).Recommendation, global::System.Convert.ToString); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).Severity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).Severity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity.CreateFrom); + } + if (content.Contains("DetailedInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).DetailedInformation = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation) content.GetValueForProperty("DetailedInformation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).DetailedInformation, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertPropertiesDetailedInformationTypeConverter.ConvertFrom); + } + if (content.Contains("ErrorDetailErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).ErrorDetailErrorCode = (string) content.GetValueForProperty("ErrorDetailErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).ErrorDetailErrorCode, global::System.Convert.ToString); + } + if (content.Contains("ErrorDetailErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).ErrorDetailErrorMessage = (string) content.GetValueForProperty("ErrorDetailErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).ErrorDetailErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("ErrorDetailOccurrence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).ErrorDetailOccurrence = (int?) content.GetValueForProperty("ErrorDetailOccurrence",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal)this).ErrorDetailOccurrence, (__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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IAlertProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/AlertProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertProperties.TypeConverter.cs new file mode 100644 index 000000000000..b4e80c2f4dcb --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IAlertProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/AlertProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertProperties.cs new file mode 100644 index 000000000000..e77a8c74cafc --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertProperties.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Properties of alert. + public partial class AlertProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal + { + + /// Backing field for property. + private string _alertType; + + /// Alert type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string AlertType { get => this._alertType; } + + /// Backing field for property. + private global::System.DateTime? _appearedAtDateTime; + + /// UTC time when the alert appeared. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? AppearedAtDateTime { get => this._appearedAtDateTime; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation _detailedInformation; + + /// Alert details. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation DetailedInformation { get => (this._detailedInformation = this._detailedInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertPropertiesDetailedInformation()); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetails _errorDetail; + + /// Error details of the alert. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetails ErrorDetail { get => (this._errorDetail = this._errorDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertErrorDetails()); } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ErrorDetailErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)ErrorDetail).ErrorCode; } + + /// Error Message. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ErrorDetailErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)ErrorDetail).ErrorMessage; } + + /// Number of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? ErrorDetailOccurrence { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)ErrorDetail).Occurrence; } + + /// Internal Acessors for AlertType + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal.AlertType { get => this._alertType; set { {_alertType = value;} } } + + /// Internal Acessors for AppearedAtDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal.AppearedAtDateTime { get => this._appearedAtDateTime; set { {_appearedAtDateTime = value;} } } + + /// Internal Acessors for DetailedInformation + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal.DetailedInformation { get => (this._detailedInformation = this._detailedInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertPropertiesDetailedInformation()); set { {_detailedInformation = value;} } } + + /// Internal Acessors for ErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetails Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal.ErrorDetail { get => (this._errorDetail = this._errorDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertErrorDetails()); set { {_errorDetail = value;} } } + + /// Internal Acessors for ErrorDetailErrorCode + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal.ErrorDetailErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)ErrorDetail).ErrorCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)ErrorDetail).ErrorCode = value; } + + /// Internal Acessors for ErrorDetailErrorMessage + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal.ErrorDetailErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)ErrorDetail).ErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)ErrorDetail).ErrorMessage = value; } + + /// Internal Acessors for ErrorDetailOccurrence + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal.ErrorDetailOccurrence { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)ErrorDetail).Occurrence; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetailsInternal)ErrorDetail).Occurrence = value; } + + /// Internal Acessors for Recommendation + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal.Recommendation { get => this._recommendation; set { {_recommendation = value;} } } + + /// Internal Acessors for Severity + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal.Severity { get => this._severity; set { {_severity = value;} } } + + /// Internal Acessors for Title + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesInternal.Title { get => this._title; set { {_title = value;} } } + + /// Backing field for property. + private string _recommendation; + + /// Alert recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Recommendation { get => this._recommendation; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity? _severity; + + /// Severity of the alert. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity? Severity { get => this._severity; } + + /// Backing field for property. + private string _title; + + /// Alert title. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Title { get => this._title; } + + /// Creates an new instance. + public AlertProperties() + { + + } + } + /// Properties of alert. + public partial interface IAlertProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Alert type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Alert type.", + SerializedName = @"alertType", + PossibleTypes = new [] { typeof(string) })] + string AlertType { get; } + /// UTC time when the alert appeared. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"UTC time when the alert appeared.", + SerializedName = @"appearedAtDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? AppearedAtDateTime { get; } + /// Alert details. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Alert details.", + SerializedName = @"detailedInformation", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation DetailedInformation { get; } + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"errorCode", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailErrorCode { get; } + /// Error Message. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error Message.", + SerializedName = @"errorMessage", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailErrorMessage { get; } + /// Number of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of occurrences.", + SerializedName = @"occurrences", + PossibleTypes = new [] { typeof(int) })] + int? ErrorDetailOccurrence { get; } + /// Alert recommendation. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Alert recommendation.", + SerializedName = @"recommendation", + PossibleTypes = new [] { typeof(string) })] + string Recommendation { get; } + /// Severity of the alert. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Severity of the alert.", + SerializedName = @"severity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity? Severity { get; } + /// Alert title. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Alert title.", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; } + + } + /// Properties of alert. + internal partial interface IAlertPropertiesInternal + + { + /// Alert type. + string AlertType { get; set; } + /// UTC time when the alert appeared. + global::System.DateTime? AppearedAtDateTime { get; set; } + /// Alert details. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation DetailedInformation { get; set; } + /// Error details of the alert. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertErrorDetails ErrorDetail { get; set; } + /// Error code. + string ErrorDetailErrorCode { get; set; } + /// Error Message. + string ErrorDetailErrorMessage { get; set; } + /// Number of occurrences. + int? ErrorDetailOccurrence { get; set; } + /// Alert recommendation. + string Recommendation { get; set; } + /// Severity of the alert. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity? Severity { get; set; } + /// Alert title. + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertProperties.json.cs new file mode 100644 index 000000000000..ec2e0a296f37 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertProperties.json.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal AlertProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_errorDetail = If( json?.PropertyT("errorDetails"), out var __jsonErrorDetails) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertErrorDetails.FromJson(__jsonErrorDetails) : ErrorDetail;} + {_title = If( json?.PropertyT("title"), out var __jsonTitle) ? (string)__jsonTitle : (string)Title;} + {_alertType = If( json?.PropertyT("alertType"), out var __jsonAlertType) ? (string)__jsonAlertType : (string)AlertType;} + {_appearedAtDateTime = If( json?.PropertyT("appearedAtDateTime"), out var __jsonAppearedAtDateTime) ? global::System.DateTime.TryParse((string)__jsonAppearedAtDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonAppearedAtDateTimeValue) ? __jsonAppearedAtDateTimeValue : AppearedAtDateTime : AppearedAtDateTime;} + {_recommendation = If( json?.PropertyT("recommendation"), out var __jsonRecommendation) ? (string)__jsonRecommendation : (string)Recommendation;} + {_severity = If( json?.PropertyT("severity"), out var __jsonSeverity) ? (string)__jsonSeverity : (string)Severity;} + {_detailedInformation = If( json?.PropertyT("detailedInformation"), out var __jsonDetailedInformation) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AlertPropertiesDetailedInformation.FromJson(__jsonDetailedInformation) : DetailedInformation;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._errorDetail ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._errorDetail.ToJson(null,serializationMode) : null, "errorDetails" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._title)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._title.ToString()) : null, "title" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._alertType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._alertType.ToString()) : null, "alertType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._appearedAtDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._appearedAtDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "appearedAtDateTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._recommendation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._recommendation.ToString()) : null, "recommendation" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._severity)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._severity.ToString()) : null, "severity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._detailedInformation ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/AlertPropertiesDetailedInformation.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertPropertiesDetailedInformation.PowerShell.cs new file mode 100644 index 000000000000..fb57f270336f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertPropertiesDetailedInformation.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Alert details. + [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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Alert details. + [System.ComponentModel.TypeConverter(typeof(AlertPropertiesDetailedInformationTypeConverter))] + public partial interface IAlertPropertiesDetailedInformation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertPropertiesDetailedInformation.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertPropertiesDetailedInformation.TypeConverter.cs new file mode 100644 index 000000000000..d3a4d61ec2d5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertPropertiesDetailedInformation.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/AlertPropertiesDetailedInformation.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertPropertiesDetailedInformation.cs new file mode 100644 index 000000000000..6a0b2c903fd9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Alert details. + public partial class AlertPropertiesDetailedInformation : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformationInternal + { + + /// Creates an new instance. + public AlertPropertiesDetailedInformation() + { + + } + } + /// Alert details. + public partial interface IAlertPropertiesDetailedInformation : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray + { + + } + /// Alert details. + internal partial interface IAlertPropertiesDetailedInformationInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertPropertiesDetailedInformation.dictionary.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertPropertiesDetailedInformation.dictionary.cs new file mode 100644 index 000000000000..a3194c270b28 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + public partial class AlertPropertiesDetailedInformation : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.AlertPropertiesDetailedInformation source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertPropertiesDetailedInformation.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertPropertiesDetailedInformation.json.cs new file mode 100644 index 000000000000..b76a2dfcfbe4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AlertPropertiesDetailedInformation.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Alert details. + 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AlertPropertiesDetailedInformation(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlertPropertiesDetailedInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddon.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddon.PowerShell.cs new file mode 100644 index 000000000000..606784d4be88 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddon.PowerShell.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Arc Addon. + [System.ComponentModel.TypeConverter(typeof(ArcAddonTypeConverter))] + public partial class ArcAddon + { + + /// + /// 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 ArcAddon(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.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArcAddonPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType.CreateFrom); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("ResourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).ResourceLocation = (string) content.GetValueForProperty("ResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).ResourceLocation, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("HostPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).HostPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType?) content.GetValueForProperty("HostPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).HostPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType.CreateFrom); + } + if (content.Contains("HostPlatformType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).HostPlatformType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType?) content.GetValueForProperty("HostPlatformType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).HostPlatformType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType.CreateFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ArcAddon(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.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArcAddonPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType.CreateFrom); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("ResourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).ResourceLocation = (string) content.GetValueForProperty("ResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).ResourceLocation, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("HostPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).HostPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType?) content.GetValueForProperty("HostPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).HostPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType.CreateFrom); + } + if (content.Contains("HostPlatformType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).HostPlatformType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType?) content.GetValueForProperty("HostPlatformType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).HostPlatformType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType.CreateFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState.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.DataBoxEdge.Models.Api20220301.IArcAddon DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ArcAddon(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.DataBoxEdge.Models.Api20220301.IArcAddon DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ArcAddon(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.DataBoxEdge.Models.Api20220301.IArcAddon FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Arc Addon. + [System.ComponentModel.TypeConverter(typeof(ArcAddonTypeConverter))] + public partial interface IArcAddon + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddon.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddon.TypeConverter.cs new file mode 100644 index 000000000000..ce9aae987589 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddon.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ArcAddonTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IArcAddon ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddon).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ArcAddon.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ArcAddon.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ArcAddon.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/databoxedge/generated/api/Models/Api20220301/ArcAddon.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddon.cs new file mode 100644 index 000000000000..b857e96a31c9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddon.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Arc Addon. + public partial class ArcAddon : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddon, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon __addon = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Addon(); + + /// Host OS supported by the Arc addon. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? HostPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).HostPlatform; } + + /// Platform where the runtime is hosted. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).HostPlatformType; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__addon).Id; } + + /// Addon type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).Kind = value ; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemData = value; } + + /// Internal Acessors for HostPlatform + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal.HostPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).HostPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).HostPlatform = value; } + + /// Internal Acessors for HostPlatformType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal.HostPlatformType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).HostPlatformType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).HostPlatformType = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArcAddonProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonInternal.Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).Version = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__addon).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__addon).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__addon).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__addon).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__addon).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__addon).Type = value; } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__addon).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonProperties _property; + + /// Properties specific to Arc addon. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArcAddonProperties()); set => this._property = value; } + + /// Addon Provisioning State + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).ProvisioningState; } + + /// Arc resource group name + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ResourceGroupName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).ResourceGroupName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).ResourceGroupName = value ; } + + /// Arc resource location + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ResourceLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).ResourceLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).ResourceLocation = value ; } + + /// Arc resource Name + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ResourceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).ResourceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).ResourceName = value ; } + + /// Arc resource subscription Id + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).SubscriptionId = value ; } + + /// Metadata pertaining to creation and last modification of Addon + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__addon).Type; } + + /// Arc resource version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)Property).Version; } + + /// Creates an new instance. + public ArcAddon() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__addon), __addon); + await eventListener.AssertObjectIsValid(nameof(__addon), __addon); + } + } + /// Arc Addon. + public partial interface IArcAddon : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon + { + /// Host OS supported by the Arc addon. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Host OS supported by the Arc addon.", + SerializedName = @"hostPlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? HostPlatform { get; } + /// Platform where the runtime is hosted. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Platform where the runtime is hosted.", + SerializedName = @"hostPlatformType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get; } + /// Addon Provisioning State + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Addon Provisioning State", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState? ProvisioningState { get; } + /// Arc resource group name + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Arc resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroupName { get; set; } + /// Arc resource location + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Arc resource location", + SerializedName = @"resourceLocation", + PossibleTypes = new [] { typeof(string) })] + string ResourceLocation { get; set; } + /// Arc resource Name + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Arc resource Name", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + string ResourceName { get; set; } + /// Arc resource subscription Id + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Arc resource subscription Id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + /// Arc resource version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Arc resource version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; } + + } + /// Arc Addon. + internal partial interface IArcAddonInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal + { + /// Host OS supported by the Arc addon. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? HostPlatform { get; set; } + /// Platform where the runtime is hosted. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get; set; } + /// Properties specific to Arc addon. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonProperties Property { get; set; } + /// Addon Provisioning State + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState? ProvisioningState { get; set; } + /// Arc resource group name + string ResourceGroupName { get; set; } + /// Arc resource location + string ResourceLocation { get; set; } + /// Arc resource Name + string ResourceName { get; set; } + /// Arc resource subscription Id + string SubscriptionId { get; set; } + /// Arc resource version + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddon.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddon.json.cs new file mode 100644 index 000000000000..cf2d3750c1a4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddon.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Arc Addon. + public partial class ArcAddon + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ArcAddon(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __addon = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Addon(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArcAddonProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddon. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddon. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddon FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ArcAddon(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __addon?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/ArcAddonProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddonProperties.PowerShell.cs new file mode 100644 index 000000000000..b7881a77e791 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddonProperties.PowerShell.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Arc addon properties. + [System.ComponentModel.TypeConverter(typeof(ArcAddonPropertiesTypeConverter))] + public partial class ArcAddonProperties + { + + /// + /// 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 ArcAddonProperties(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.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("ResourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).ResourceLocation = (string) content.GetValueForProperty("ResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).ResourceLocation, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("HostPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).HostPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType?) content.GetValueForProperty("HostPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).HostPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType.CreateFrom); + } + if (content.Contains("HostPlatformType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).HostPlatformType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType?) content.GetValueForProperty("HostPlatformType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).HostPlatformType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType.CreateFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ArcAddonProperties(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.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("ResourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).ResourceLocation = (string) content.GetValueForProperty("ResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).ResourceLocation, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("HostPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).HostPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType?) content.GetValueForProperty("HostPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).HostPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType.CreateFrom); + } + if (content.Contains("HostPlatformType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).HostPlatformType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType?) content.GetValueForProperty("HostPlatformType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).HostPlatformType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType.CreateFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState.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.DataBoxEdge.Models.Api20220301.IArcAddonProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ArcAddonProperties(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.DataBoxEdge.Models.Api20220301.IArcAddonProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ArcAddonProperties(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.DataBoxEdge.Models.Api20220301.IArcAddonProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Arc addon properties. + [System.ComponentModel.TypeConverter(typeof(ArcAddonPropertiesTypeConverter))] + public partial interface IArcAddonProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddonProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddonProperties.TypeConverter.cs new file mode 100644 index 000000000000..4d1c024e856c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddonProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ArcAddonPropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IArcAddonProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ArcAddonProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ArcAddonProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ArcAddonProperties.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/databoxedge/generated/api/Models/Api20220301/ArcAddonProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddonProperties.cs new file mode 100644 index 000000000000..651fb0521b66 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddonProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Arc addon properties. + public partial class ArcAddonProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? _hostPlatform; + + /// Host OS supported by the Arc addon. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? HostPlatform { get => this._hostPlatform; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? _hostPlatformType; + + /// Platform where the runtime is hosted. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get => this._hostPlatformType; } + + /// Internal Acessors for HostPlatform + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal.HostPlatform { get => this._hostPlatform; set { {_hostPlatform = value;} } } + + /// Internal Acessors for HostPlatformType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal.HostPlatformType { get => this._hostPlatformType; set { {_hostPlatformType = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonPropertiesInternal.Version { get => this._version; set { {_version = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState? _provisioningState; + + /// Addon Provisioning State + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState? ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private string _resourceGroupName; + + /// Arc resource group name + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceLocation; + + /// Arc resource location + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ResourceLocation { get => this._resourceLocation; set => this._resourceLocation = value; } + + /// Backing field for property. + private string _resourceName; + + /// Arc resource Name + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// Arc resource subscription Id + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _version; + + /// Arc resource version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Version { get => this._version; } + + /// Creates an new instance. + public ArcAddonProperties() + { + + } + } + /// Arc addon properties. + public partial interface IArcAddonProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Host OS supported by the Arc addon. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Host OS supported by the Arc addon.", + SerializedName = @"hostPlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? HostPlatform { get; } + /// Platform where the runtime is hosted. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Platform where the runtime is hosted.", + SerializedName = @"hostPlatformType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get; } + /// Addon Provisioning State + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Addon Provisioning State", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState? ProvisioningState { get; } + /// Arc resource group name + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Arc resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroupName { get; set; } + /// Arc resource location + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Arc resource location", + SerializedName = @"resourceLocation", + PossibleTypes = new [] { typeof(string) })] + string ResourceLocation { get; set; } + /// Arc resource Name + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Arc resource Name", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + string ResourceName { get; set; } + /// Arc resource subscription Id + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Arc resource subscription Id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + /// Arc resource version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Arc resource version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; } + + } + /// Arc addon properties. + internal partial interface IArcAddonPropertiesInternal + + { + /// Host OS supported by the Arc addon. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? HostPlatform { get; set; } + /// Platform where the runtime is hosted. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get; set; } + /// Addon Provisioning State + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState? ProvisioningState { get; set; } + /// Arc resource group name + string ResourceGroupName { get; set; } + /// Arc resource location + string ResourceLocation { get; set; } + /// Arc resource Name + string ResourceName { get; set; } + /// Arc resource subscription Id + string SubscriptionId { get; set; } + /// Arc resource version + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddonProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddonProperties.json.cs new file mode 100644 index 000000000000..de00b911e477 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArcAddonProperties.json.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Arc addon properties. + public partial class ArcAddonProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ArcAddonProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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;} + {_resourceName = If( json?.PropertyT("resourceName"), out var __jsonResourceName) ? (string)__jsonResourceName : (string)ResourceName;} + {_resourceLocation = If( json?.PropertyT("resourceLocation"), out var __jsonResourceLocation) ? (string)__jsonResourceLocation : (string)ResourceLocation;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + {_hostPlatform = If( json?.PropertyT("hostPlatform"), out var __jsonHostPlatform) ? (string)__jsonHostPlatform : (string)HostPlatform;} + {_hostPlatformType = If( json?.PropertyT("hostPlatformType"), out var __jsonHostPlatformType) ? (string)__jsonHostPlatformType : (string)HostPlatformType;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArcAddonProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ArcAddonProperties(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); + AddIf( null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName" ,container.Add ); + AddIf( null != (((object)this._resourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._resourceName.ToString()) : null, "resourceName" ,container.Add ); + AddIf( null != (((object)this._resourceLocation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._resourceLocation.ToString()) : null, "resourceLocation" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._hostPlatform)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._hostPlatform.ToString()) : null, "hostPlatform" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._hostPlatformType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._hostPlatformType.ToString()) : null, "hostPlatformType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/ArmBaseModel.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArmBaseModel.PowerShell.cs new file mode 100644 index 000000000000..b7cc223fa46c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArmBaseModel.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Represents the base class for all object models. + [System.ComponentModel.TypeConverter(typeof(ArmBaseModelTypeConverter))] + public partial class ArmBaseModel + { + + /// + /// 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 ArmBaseModel(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.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)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 ArmBaseModel(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.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)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.DataBoxEdge.Models.Api20220301.IArmBaseModel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ArmBaseModel(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.DataBoxEdge.Models.Api20220301.IArmBaseModel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ArmBaseModel(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.DataBoxEdge.Models.Api20220301.IArmBaseModel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Represents the base class for all object models. + [System.ComponentModel.TypeConverter(typeof(ArmBaseModelTypeConverter))] + public partial interface IArmBaseModel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ArmBaseModel.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArmBaseModel.TypeConverter.cs new file mode 100644 index 000000000000..fc8a258189d4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArmBaseModel.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ArmBaseModelTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IArmBaseModel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ArmBaseModel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ArmBaseModel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ArmBaseModel.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/databoxedge/generated/api/Models/Api20220301/ArmBaseModel.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArmBaseModel.cs new file mode 100644 index 000000000000..7e0aa6daaa69 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArmBaseModel.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Represents the base class for all object models. + public partial class ArmBaseModel : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + + /// Backing field for property. + private string _id; + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _type; + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public ArmBaseModel() + { + + } + } + /// Represents the base class for all object models. + public partial interface IArmBaseModel : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The path ID that uniquely identifies the object.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The object name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The hierarchical type of the object.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// Represents the base class for all object models. + internal partial interface IArmBaseModelInternal + + { + /// The path ID that uniquely identifies the object. + string Id { get; set; } + /// The object name. + string Name { get; set; } + /// The hierarchical type of the object. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ArmBaseModel.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArmBaseModel.json.cs new file mode 100644 index 000000000000..634bec7ebaec --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ArmBaseModel.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Represents the base class for all object models. + public partial class ArmBaseModel + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ArmBaseModel(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IArmBaseModel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ArmBaseModel(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/AsymmetricEncryptedSecret.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AsymmetricEncryptedSecret.PowerShell.cs new file mode 100644 index 000000000000..3825e87795fe --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AsymmetricEncryptedSecret.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Represent the secrets intended for encryption with asymmetric key pair. + [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.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("EncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)this).EncryptionCertThumbprint = (string) content.GetValueForProperty("EncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)this).EncryptionCertThumbprint, global::System.Convert.ToString); + } + if (content.Contains("EncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)this).EncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("EncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)this).EncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("EncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)this).EncryptionCertThumbprint = (string) content.GetValueForProperty("EncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)this).EncryptionCertThumbprint, global::System.Convert.ToString); + } + if (content.Contains("EncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)this).EncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("EncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)this).EncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Represent the secrets intended for encryption with asymmetric key pair. + [System.ComponentModel.TypeConverter(typeof(AsymmetricEncryptedSecretTypeConverter))] + public partial interface IAsymmetricEncryptedSecret + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/AsymmetricEncryptedSecret.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AsymmetricEncryptedSecret.TypeConverter.cs new file mode 100644 index 000000000000..46e0384cf623 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/AsymmetricEncryptedSecret.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AsymmetricEncryptedSecret.cs new file mode 100644 index 000000000000..a3b5ff3f660e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AsymmetricEncryptedSecret.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Represent the secrets intended for encryption with asymmetric key pair. + public partial class AsymmetricEncryptedSecret : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm _encryptionAlgorithm; + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm EncryptionAlgorithm { get => this._encryptionAlgorithm; set => this._encryptionAlgorithm = value; } + + /// Backing field for property. + private string _encryptionCertThumbprint; + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string EncryptionCertThumbprint { get => this._encryptionCertThumbprint; set => this._encryptionCertThumbprint = value; } + + /// Backing field for property. + private string _value; + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public AsymmetricEncryptedSecret() + { + + } + } + /// Represent the secrets intended for encryption with asymmetric key pair. + public partial interface IAsymmetricEncryptedSecret : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm EncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string EncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// Represent the secrets intended for encryption with asymmetric key pair. + internal partial interface IAsymmetricEncryptedSecretInternal + + { + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm EncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string EncryptionCertThumbprint { get; set; } + /// The value of the secret. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/AsymmetricEncryptedSecret.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AsymmetricEncryptedSecret.json.cs new file mode 100644 index 000000000000..2da4f03d5992 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AsymmetricEncryptedSecret.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Represent the secrets intended for encryption with asymmetric key pair. + 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal AsymmetricEncryptedSecret(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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;} + {_encryptionCertThumbprint = If( json?.PropertyT("encryptionCertThumbprint"), out var __jsonEncryptionCertThumbprint) ? (string)__jsonEncryptionCertThumbprint : (string)EncryptionCertThumbprint;} + {_encryptionAlgorithm = If( json?.PropertyT("encryptionAlgorithm"), out var __jsonEncryptionAlgorithm) ? (string)__jsonEncryptionAlgorithm : (string)EncryptionAlgorithm;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AddIf( null != (((object)this._encryptionCertThumbprint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._encryptionCertThumbprint.ToString()) : null, "encryptionCertThumbprint" ,container.Add ); + AddIf( null != (((object)this._encryptionAlgorithm)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/Authentication.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Authentication.PowerShell.cs new file mode 100644 index 000000000000..96f8e0084e5e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Authentication.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Authentication mechanism for IoT devices. + [System.ComponentModel.TypeConverter(typeof(AuthenticationTypeConverter))] + public partial class Authentication + { + + /// + /// 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 Authentication(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).SymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("SymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).SymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("SymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).SymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("SymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).SymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).ConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("ConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).ConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("ConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).ConnectionStringValue = (string) content.GetValueForProperty("ConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).ConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("ConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).ConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("ConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).ConnectionStringEncryptionCertThumbprint, 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 Authentication(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).SymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("SymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).SymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("SymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).SymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("SymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).SymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).ConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("ConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).ConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("ConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).ConnectionStringValue = (string) content.GetValueForProperty("ConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).ConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("ConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).ConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("ConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)this).ConnectionStringEncryptionCertThumbprint, 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.DataBoxEdge.Models.Api20220301.IAuthentication DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Authentication(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.DataBoxEdge.Models.Api20220301.IAuthentication DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Authentication(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.DataBoxEdge.Models.Api20220301.IAuthentication FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Authentication mechanism for IoT devices. + [System.ComponentModel.TypeConverter(typeof(AuthenticationTypeConverter))] + public partial interface IAuthentication + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Authentication.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Authentication.TypeConverter.cs new file mode 100644 index 000000000000..49c46ea343ec --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Authentication.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AuthenticationTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IAuthentication ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Authentication.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Authentication.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Authentication.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/databoxedge/generated/api/Models/Api20220301/Authentication.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Authentication.cs new file mode 100644 index 000000000000..d435bb5551d6 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Authentication.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Authentication mechanism for IoT devices. + public partial class Authentication : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal + { + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? ConnectionStringEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)SymmetricKey).ConnectionStringEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)SymmetricKey).ConnectionStringEncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ConnectionStringEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)SymmetricKey).ConnectionStringEncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)SymmetricKey).ConnectionStringEncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ConnectionStringValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)SymmetricKey).ConnectionStringValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)SymmetricKey).ConnectionStringValue = value ?? null; } + + /// Internal Acessors for SymmetricKey + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal.SymmetricKey { get => (this._symmetricKey = this._symmetricKey ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKey()); set { {_symmetricKey = value;} } } + + /// Internal Acessors for SymmetricKeyConnectionString + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal.SymmetricKeyConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)SymmetricKey).ConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)SymmetricKey).ConnectionString = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey _symmetricKey; + + /// Symmetric key for authentication. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey SymmetricKey { get => (this._symmetricKey = this._symmetricKey ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKey()); set => this._symmetricKey = value; } + + /// Creates an new instance. + public Authentication() + { + + } + } + /// Authentication mechanism for IoT devices. + public partial interface IAuthentication : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? ConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string ConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string ConnectionStringValue { get; set; } + + } + /// Authentication mechanism for IoT devices. + internal partial interface IAuthenticationInternal + + { + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? ConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string ConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string ConnectionStringValue { get; set; } + /// Symmetric key for authentication. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey SymmetricKey { get; set; } + /// Connection string based on the symmetric key. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret SymmetricKeyConnectionString { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Authentication.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Authentication.json.cs new file mode 100644 index 000000000000..6ef80359d971 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Authentication.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Authentication mechanism for IoT devices. + public partial class Authentication + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal Authentication(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_symmetricKey = If( json?.PropertyT("symmetricKey"), out var __jsonSymmetricKey) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKey.FromJson(__jsonSymmetricKey) : SymmetricKey;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new Authentication(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._symmetricKey ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._symmetricKey.ToJson(null,serializationMode) : null, "symmetricKey" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/AzureContainerInfo.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AzureContainerInfo.PowerShell.cs new file mode 100644 index 000000000000..060013a678c6 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AzureContainerInfo.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Azure container mapping of the endpoint. + [System.ComponentModel.TypeConverter(typeof(AzureContainerInfoTypeConverter))] + public partial class AzureContainerInfo + { + + /// + /// 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 AzureContainerInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StorageAccountCredentialId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfoInternal)this).StorageAccountCredentialId = (string) content.GetValueForProperty("StorageAccountCredentialId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfoInternal)this).StorageAccountCredentialId, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfoInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfoInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("DataFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfoInternal)this).DataFormat = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat) content.GetValueForProperty("DataFormat",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfoInternal)this).DataFormat, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureContainerInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StorageAccountCredentialId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfoInternal)this).StorageAccountCredentialId = (string) content.GetValueForProperty("StorageAccountCredentialId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfoInternal)this).StorageAccountCredentialId, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfoInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfoInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("DataFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfoInternal)this).DataFormat = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat) content.GetValueForProperty("DataFormat",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfoInternal)this).DataFormat, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat.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.DataBoxEdge.Models.Api20220301.IAzureContainerInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureContainerInfo(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.DataBoxEdge.Models.Api20220301.IAzureContainerInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureContainerInfo(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.DataBoxEdge.Models.Api20220301.IAzureContainerInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure container mapping of the endpoint. + [System.ComponentModel.TypeConverter(typeof(AzureContainerInfoTypeConverter))] + public partial interface IAzureContainerInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/AzureContainerInfo.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AzureContainerInfo.TypeConverter.cs new file mode 100644 index 000000000000..cce87b1738ed --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AzureContainerInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureContainerInfoTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IAzureContainerInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureContainerInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureContainerInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureContainerInfo.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/databoxedge/generated/api/Models/Api20220301/AzureContainerInfo.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AzureContainerInfo.cs new file mode 100644 index 000000000000..fe137c7fee25 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AzureContainerInfo.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Azure container mapping of the endpoint. + public partial class AzureContainerInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfoInternal + { + + /// Backing field for property. + private string _containerName; + + /// + /// Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob). + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat _dataFormat; + + /// Storage format used for the file represented by the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat DataFormat { get => this._dataFormat; set => this._dataFormat = value; } + + /// Backing field for property. + private string _storageAccountCredentialId; + + /// ID of the storage account credential used to access storage. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string StorageAccountCredentialId { get => this._storageAccountCredentialId; set => this._storageAccountCredentialId = value; } + + /// Creates an new instance. + public AzureContainerInfo() + { + + } + } + /// Azure container mapping of the endpoint. + public partial interface IAzureContainerInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// + /// Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob). + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob).", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + string ContainerName { get; set; } + /// Storage format used for the file represented by the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Storage format used for the file represented by the share.", + SerializedName = @"dataFormat", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat DataFormat { get; set; } + /// ID of the storage account credential used to access storage. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"ID of the storage account credential used to access storage.", + SerializedName = @"storageAccountCredentialId", + PossibleTypes = new [] { typeof(string) })] + string StorageAccountCredentialId { get; set; } + + } + /// Azure container mapping of the endpoint. + internal partial interface IAzureContainerInfoInternal + + { + /// + /// Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob). + /// + string ContainerName { get; set; } + /// Storage format used for the file represented by the share. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat DataFormat { get; set; } + /// ID of the storage account credential used to access storage. + string StorageAccountCredentialId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/AzureContainerInfo.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/AzureContainerInfo.json.cs new file mode 100644 index 000000000000..05a2a796b5ae --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/AzureContainerInfo.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Azure container mapping of the endpoint. + public partial class AzureContainerInfo + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal AzureContainerInfo(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_storageAccountCredentialId = If( json?.PropertyT("storageAccountCredentialId"), out var __jsonStorageAccountCredentialId) ? (string)__jsonStorageAccountCredentialId : (string)StorageAccountCredentialId;} + {_containerName = If( json?.PropertyT("containerName"), out var __jsonContainerName) ? (string)__jsonContainerName : (string)ContainerName;} + {_dataFormat = If( json?.PropertyT("dataFormat"), out var __jsonDataFormat) ? (string)__jsonDataFormat : (string)DataFormat;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new AzureContainerInfo(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._storageAccountCredentialId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._storageAccountCredentialId.ToString()) : null, "storageAccountCredentialId" ,container.Add ); + AddIf( null != (((object)this._containerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._containerName.ToString()) : null, "containerName" ,container.Add ); + AddIf( null != (((object)this._dataFormat)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._dataFormat.ToString()) : null, "dataFormat" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedule.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedule.PowerShell.cs new file mode 100644 index 000000000000..7c15f2e3e09a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedule.PowerShell.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The bandwidth schedule details. + [System.ComponentModel.TypeConverter(typeof(BandwidthScheduleTypeConverter))] + public partial class BandwidthSchedule + { + + /// + /// 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 BandwidthSchedule(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.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.BandwidthSchedulePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Start")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).Start = (string) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).Start, global::System.Convert.ToString); + } + if (content.Contains("Stop")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).Stop = (string) content.GetValueForProperty("Stop",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).Stop, global::System.Convert.ToString); + } + if (content.Contains("RateInMbps")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).RateInMbps = (int) content.GetValueForProperty("RateInMbps",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).RateInMbps, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).Day = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek[]) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).Day, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek.CreateFrom)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataLastModifiedAt, (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 BandwidthSchedule(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.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.BandwidthSchedulePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Start")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).Start = (string) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).Start, global::System.Convert.ToString); + } + if (content.Contains("Stop")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).Stop = (string) content.GetValueForProperty("Stop",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).Stop, global::System.Convert.ToString); + } + if (content.Contains("RateInMbps")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).RateInMbps = (int) content.GetValueForProperty("RateInMbps",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).RateInMbps, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).Day = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek[]) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).Day, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek.CreateFrom)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal)this).SystemDataLastModifiedAt, (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.DataBoxEdge.Models.Api20220301.IBandwidthSchedule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BandwidthSchedule(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.DataBoxEdge.Models.Api20220301.IBandwidthSchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BandwidthSchedule(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.DataBoxEdge.Models.Api20220301.IBandwidthSchedule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The bandwidth schedule details. + [System.ComponentModel.TypeConverter(typeof(BandwidthScheduleTypeConverter))] + public partial interface IBandwidthSchedule + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedule.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedule.TypeConverter.cs new file mode 100644 index 000000000000..ed4d575958ba --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedule.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BandwidthScheduleTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IBandwidthSchedule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BandwidthSchedule.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BandwidthSchedule.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BandwidthSchedule.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/databoxedge/generated/api/Models/Api20220301/BandwidthSchedule.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedule.cs new file mode 100644 index 000000000000..32a4bad24d1e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedule.cs @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The bandwidth schedule details. + public partial class BandwidthSchedule : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// The days of the week when this schedule is applicable. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek[] Day { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)Property).Day; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)Property).Day = value ; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.BandwidthScheduleProperties()); set { {_property = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleProperties _property; + + /// The properties of the bandwidth schedule. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.BandwidthScheduleProperties()); set => this._property = value; } + + /// The bandwidth rate in Mbps. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int RateInMbps { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)Property).RateInMbps; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)Property).RateInMbps = value ; } + + /// The start time of the schedule in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Start { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)Property).Start; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)Property).Start = value ; } + + /// The stop time of the schedule in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Stop { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)Property).Stop; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)Property).Stop = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of BandwidthSchedule + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Creates an new instance. + public BandwidthSchedule() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// The bandwidth schedule details. + public partial interface IBandwidthSchedule : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// The days of the week when this schedule is applicable. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The days of the week when this schedule is applicable.", + SerializedName = @"days", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek[] Day { get; set; } + /// The bandwidth rate in Mbps. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The bandwidth rate in Mbps.", + SerializedName = @"rateInMbps", + PossibleTypes = new [] { typeof(int) })] + int RateInMbps { get; set; } + /// The start time of the schedule in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The start time of the schedule in UTC.", + SerializedName = @"start", + PossibleTypes = new [] { typeof(string) })] + string Start { get; set; } + /// The stop time of the schedule in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The stop time of the schedule in UTC.", + SerializedName = @"stop", + PossibleTypes = new [] { typeof(string) })] + string Stop { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// The bandwidth schedule details. + internal partial interface IBandwidthScheduleInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// The days of the week when this schedule is applicable. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek[] Day { get; set; } + /// The properties of the bandwidth schedule. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleProperties Property { get; set; } + /// The bandwidth rate in Mbps. + int RateInMbps { get; set; } + /// The start time of the schedule in UTC. + string Start { get; set; } + /// The stop time of the schedule in UTC. + string Stop { get; set; } + /// Metadata pertaining to creation and last modification of BandwidthSchedule + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedule.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedule.json.cs new file mode 100644 index 000000000000..f3aae4ee7b07 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedule.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The bandwidth schedule details. + public partial class BandwidthSchedule + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal BandwidthSchedule(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.BandwidthScheduleProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new BandwidthSchedule(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthScheduleProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthScheduleProperties.PowerShell.cs new file mode 100644 index 000000000000..20cab91faf90 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthScheduleProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The properties of the bandwidth schedule. + [System.ComponentModel.TypeConverter(typeof(BandwidthSchedulePropertiesTypeConverter))] + public partial class BandwidthScheduleProperties + { + + /// + /// 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 BandwidthScheduleProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Start")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)this).Start = (string) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)this).Start, global::System.Convert.ToString); + } + if (content.Contains("Stop")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)this).Stop = (string) content.GetValueForProperty("Stop",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)this).Stop, global::System.Convert.ToString); + } + if (content.Contains("RateInMbps")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)this).RateInMbps = (int) content.GetValueForProperty("RateInMbps",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)this).RateInMbps, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)this).Day = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek[]) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)this).Day, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek.CreateFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BandwidthScheduleProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Start")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)this).Start = (string) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)this).Start, global::System.Convert.ToString); + } + if (content.Contains("Stop")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)this).Stop = (string) content.GetValueForProperty("Stop",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)this).Stop, global::System.Convert.ToString); + } + if (content.Contains("RateInMbps")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)this).RateInMbps = (int) content.GetValueForProperty("RateInMbps",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)this).RateInMbps, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)this).Day = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek[]) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal)this).Day, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek.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.DataBoxEdge.Models.Api20220301.IBandwidthScheduleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BandwidthScheduleProperties(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.DataBoxEdge.Models.Api20220301.IBandwidthScheduleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BandwidthScheduleProperties(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.DataBoxEdge.Models.Api20220301.IBandwidthScheduleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the bandwidth schedule. + [System.ComponentModel.TypeConverter(typeof(BandwidthSchedulePropertiesTypeConverter))] + public partial interface IBandwidthScheduleProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthScheduleProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthScheduleProperties.TypeConverter.cs new file mode 100644 index 000000000000..d0adef400924 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthScheduleProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BandwidthSchedulePropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IBandwidthScheduleProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BandwidthScheduleProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BandwidthScheduleProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BandwidthScheduleProperties.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/databoxedge/generated/api/Models/Api20220301/BandwidthScheduleProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthScheduleProperties.cs new file mode 100644 index 000000000000..1f871b01421d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthScheduleProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The properties of the bandwidth schedule. + public partial class BandwidthScheduleProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulePropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek[] _day; + + /// The days of the week when this schedule is applicable. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek[] Day { get => this._day; set => this._day = value; } + + /// Backing field for property. + private int _rateInMbps; + + /// The bandwidth rate in Mbps. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int RateInMbps { get => this._rateInMbps; set => this._rateInMbps = value; } + + /// Backing field for property. + private string _start; + + /// The start time of the schedule in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Start { get => this._start; set => this._start = value; } + + /// Backing field for property. + private string _stop; + + /// The stop time of the schedule in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Stop { get => this._stop; set => this._stop = value; } + + /// Creates an new instance. + public BandwidthScheduleProperties() + { + + } + } + /// The properties of the bandwidth schedule. + public partial interface IBandwidthScheduleProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The days of the week when this schedule is applicable. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The days of the week when this schedule is applicable.", + SerializedName = @"days", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek[] Day { get; set; } + /// The bandwidth rate in Mbps. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The bandwidth rate in Mbps.", + SerializedName = @"rateInMbps", + PossibleTypes = new [] { typeof(int) })] + int RateInMbps { get; set; } + /// The start time of the schedule in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The start time of the schedule in UTC.", + SerializedName = @"start", + PossibleTypes = new [] { typeof(string) })] + string Start { get; set; } + /// The stop time of the schedule in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The stop time of the schedule in UTC.", + SerializedName = @"stop", + PossibleTypes = new [] { typeof(string) })] + string Stop { get; set; } + + } + /// The properties of the bandwidth schedule. + internal partial interface IBandwidthSchedulePropertiesInternal + + { + /// The days of the week when this schedule is applicable. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek[] Day { get; set; } + /// The bandwidth rate in Mbps. + int RateInMbps { get; set; } + /// The start time of the schedule in UTC. + string Start { get; set; } + /// The stop time of the schedule in UTC. + string Stop { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthScheduleProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthScheduleProperties.json.cs new file mode 100644 index 000000000000..73d0ea238fd0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthScheduleProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The properties of the bandwidth schedule. + public partial class BandwidthScheduleProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal BandwidthScheduleProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_start = If( json?.PropertyT("start"), out var __jsonStart) ? (string)__jsonStart : (string)Start;} + {_stop = If( json?.PropertyT("stop"), out var __jsonStop) ? (string)__jsonStop : (string)Stop;} + {_rateInMbps = If( json?.PropertyT("rateInMbps"), out var __jsonRateInMbps) ? (int)__jsonRateInMbps : RateInMbps;} + {_day = If( json?.PropertyT("days"), out var __jsonDays) ? If( __jsonDays as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Support.DayOfWeek) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek)""))) ))() : null : Day;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthScheduleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new BandwidthScheduleProperties(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._start)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._start.ToString()) : null, "start" ,container.Add ); + AddIf( null != (((object)this._stop)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._stop.ToString()) : null, "stop" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber(this._rateInMbps), "rateInMbps" ,container.Add ); + if (null != this._day) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._day ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("days",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedulesList.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedulesList.PowerShell.cs new file mode 100644 index 000000000000..4b34269f7f6c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedulesList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The collection of bandwidth schedules. + [System.ComponentModel.TypeConverter(typeof(BandwidthSchedulesListTypeConverter))] + public partial class BandwidthSchedulesList + { + + /// + /// 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 BandwidthSchedulesList(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.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.BandwidthScheduleTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesListInternal)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 BandwidthSchedulesList(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.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.BandwidthScheduleTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesListInternal)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.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BandwidthSchedulesList(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.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BandwidthSchedulesList(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.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The collection of bandwidth schedules. + [System.ComponentModel.TypeConverter(typeof(BandwidthSchedulesListTypeConverter))] + public partial interface IBandwidthSchedulesList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedulesList.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedulesList.TypeConverter.cs new file mode 100644 index 000000000000..f6e53c4a846b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedulesList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BandwidthSchedulesListTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BandwidthSchedulesList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BandwidthSchedulesList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BandwidthSchedulesList.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/databoxedge/generated/api/Models/Api20220301/BandwidthSchedulesList.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedulesList.cs new file mode 100644 index 000000000000..dda287617ed1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedulesList.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The collection of bandwidth schedules. + public partial class BandwidthSchedulesList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesList, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesListInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule[] _value; + + /// The list of bandwidth schedules. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule[] Value { get => this._value; } + + /// Creates an new instance. + public BandwidthSchedulesList() + { + + } + } + /// The collection of bandwidth schedules. + public partial interface IBandwidthSchedulesList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Link to the next set of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of bandwidth schedules. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of bandwidth schedules.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule[] Value { get; } + + } + /// The collection of bandwidth schedules. + internal partial interface IBandwidthSchedulesListInternal + + { + /// Link to the next set of results. + string NextLink { get; set; } + /// The list of bandwidth schedules. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedulesList.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedulesList.json.cs new file mode 100644 index 000000000000..3e17646df31b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/BandwidthSchedulesList.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The collection of bandwidth schedules. + public partial class BandwidthSchedulesList + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal BandwidthSchedulesList(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IBandwidthSchedule) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.BandwidthSchedule.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.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedulesList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new BandwidthSchedulesList(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/ClientAccessRight.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClientAccessRight.PowerShell.cs new file mode 100644 index 000000000000..a3d832f5bbe8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClientAccessRight.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// The mapping between a particular client IP and the type of access client has on the NFS share. + /// + [System.ComponentModel.TypeConverter(typeof(ClientAccessRightTypeConverter))] + public partial class ClientAccessRight + { + + /// + /// 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 ClientAccessRight(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Client")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRightInternal)this).Client = (string) content.GetValueForProperty("Client",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRightInternal)this).Client, global::System.Convert.ToString); + } + if (content.Contains("AccessPermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRightInternal)this).AccessPermission = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClientPermissionType) content.GetValueForProperty("AccessPermission",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRightInternal)this).AccessPermission, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClientPermissionType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ClientAccessRight(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Client")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRightInternal)this).Client = (string) content.GetValueForProperty("Client",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRightInternal)this).Client, global::System.Convert.ToString); + } + if (content.Contains("AccessPermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRightInternal)this).AccessPermission = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClientPermissionType) content.GetValueForProperty("AccessPermission",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRightInternal)this).AccessPermission, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClientPermissionType.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.DataBoxEdge.Models.Api20220301.IClientAccessRight DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClientAccessRight(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.DataBoxEdge.Models.Api20220301.IClientAccessRight DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClientAccessRight(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.DataBoxEdge.Models.Api20220301.IClientAccessRight FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The mapping between a particular client IP and the type of access client has on the NFS share. + [System.ComponentModel.TypeConverter(typeof(ClientAccessRightTypeConverter))] + public partial interface IClientAccessRight + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ClientAccessRight.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClientAccessRight.TypeConverter.cs new file mode 100644 index 000000000000..f5b824d67998 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClientAccessRight.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ClientAccessRightTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IClientAccessRight ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ClientAccessRight.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ClientAccessRight.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ClientAccessRight.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/databoxedge/generated/api/Models/Api20220301/ClientAccessRight.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClientAccessRight.cs new file mode 100644 index 000000000000..c54371c771da --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClientAccessRight.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// The mapping between a particular client IP and the type of access client has on the NFS share. + /// + public partial class ClientAccessRight : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRightInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClientPermissionType _accessPermission; + + /// Type of access to be allowed for the client. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClientPermissionType AccessPermission { get => this._accessPermission; set => this._accessPermission = value; } + + /// Backing field for property. + private string _client; + + /// IP of the client. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Client { get => this._client; set => this._client = value; } + + /// Creates an new instance. + public ClientAccessRight() + { + + } + } + /// The mapping between a particular client IP and the type of access client has on the NFS share. + public partial interface IClientAccessRight : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Type of access to be allowed for the client. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of access to be allowed for the client.", + SerializedName = @"accessPermission", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClientPermissionType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClientPermissionType AccessPermission { get; set; } + /// IP of the client. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"IP of the client.", + SerializedName = @"client", + PossibleTypes = new [] { typeof(string) })] + string Client { get; set; } + + } + /// The mapping between a particular client IP and the type of access client has on the NFS share. + internal partial interface IClientAccessRightInternal + + { + /// Type of access to be allowed for the client. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClientPermissionType AccessPermission { get; set; } + /// IP of the client. + string Client { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ClientAccessRight.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClientAccessRight.json.cs new file mode 100644 index 000000000000..3d5b107627e4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClientAccessRight.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// The mapping between a particular client IP and the type of access client has on the NFS share. + /// + public partial class ClientAccessRight + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ClientAccessRight(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_client = If( json?.PropertyT("client"), out var __jsonClient) ? (string)__jsonClient : (string)Client;} + {_accessPermission = If( json?.PropertyT("accessPermission"), out var __jsonAccessPermission) ? (string)__jsonAccessPermission : (string)AccessPermission;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ClientAccessRight(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._client)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._client.ToString()) : null, "client" ,container.Add ); + AddIf( null != (((object)this._accessPermission)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._accessPermission.ToString()) : null, "accessPermission" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRole.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRole.PowerShell.cs new file mode 100644 index 000000000000..72e3c435fbf8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRole.PowerShell.cs @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// The preview of Virtual Machine Cloud Management from the Azure supports deploying and managing VMs on your Azure Stack + /// Edge device from Azure Portal. + /// For more information, refer to: https://docs.microsoft.com/en-us/azure/databox-online/azure-stack-edge-gpu-virtual-machine-overview + /// By using this feature, you agree to the preview legal terms. See the https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/ + /// for additional details. + /// + [System.ComponentModel.TypeConverter(typeof(CloudEdgeManagementRoleTypeConverter))] + public partial class CloudEdgeManagementRole + { + + /// + /// 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 CloudEdgeManagementRole(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.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudEdgeManagementRolePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes.CreateFrom); + } + if (content.Contains("EdgeProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).EdgeProfile = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile) content.GetValueForProperty("EdgeProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).EdgeProfile, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileTypeConverter.ConvertFrom); + } + if (content.Contains("RoleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).RoleStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) content.GetValueForProperty("RoleStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).RoleStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("LocalManagementStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).LocalManagementStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus?) content.GetValueForProperty("LocalManagementStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).LocalManagementStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("EdgeProfileSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).EdgeProfileSubscription = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription) content.GetValueForProperty("EdgeProfileSubscription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).EdgeProfileSubscription, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionProperty = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties) content.GetValueForProperty("SubscriptionProperty",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionProperty, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState?) content.GetValueForProperty("SubscriptionState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState.CreateFrom); + } + if (content.Contains("SubscriptionRegistrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionRegistrationId = (string) content.GetValueForProperty("SubscriptionRegistrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionRegistrationId, global::System.Convert.ToString); + } + if (content.Contains("PropertiesEdgeProfileSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).PropertiesEdgeProfileSubscriptionId = (string) content.GetValueForProperty("PropertiesEdgeProfileSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).PropertiesEdgeProfileSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionRegistrationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionRegistrationDate = (string) content.GetValueForProperty("SubscriptionRegistrationDate",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionRegistrationDate, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("QuotaId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).QuotaId = (string) content.GetValueForProperty("QuotaId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).QuotaId, global::System.Convert.ToString); + } + if (content.Contains("SerializedDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SerializedDetail = (string) content.GetValueForProperty("SerializedDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SerializedDetail, global::System.Convert.ToString); + } + if (content.Contains("RegisteredFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).RegisteredFeature = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[]) content.GetValueForProperty("RegisteredFeature",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).RegisteredFeature, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionRegisteredFeaturesTypeConverter.ConvertFrom)); + } + if (content.Contains("LocationPlacementId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).LocationPlacementId = (string) content.GetValueForProperty("LocationPlacementId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).LocationPlacementId, 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 CloudEdgeManagementRole(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.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudEdgeManagementRolePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes.CreateFrom); + } + if (content.Contains("EdgeProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).EdgeProfile = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile) content.GetValueForProperty("EdgeProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).EdgeProfile, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileTypeConverter.ConvertFrom); + } + if (content.Contains("RoleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).RoleStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) content.GetValueForProperty("RoleStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).RoleStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("LocalManagementStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).LocalManagementStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus?) content.GetValueForProperty("LocalManagementStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).LocalManagementStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("EdgeProfileSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).EdgeProfileSubscription = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription) content.GetValueForProperty("EdgeProfileSubscription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).EdgeProfileSubscription, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionProperty = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties) content.GetValueForProperty("SubscriptionProperty",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionProperty, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState?) content.GetValueForProperty("SubscriptionState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState.CreateFrom); + } + if (content.Contains("SubscriptionRegistrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionRegistrationId = (string) content.GetValueForProperty("SubscriptionRegistrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionRegistrationId, global::System.Convert.ToString); + } + if (content.Contains("PropertiesEdgeProfileSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).PropertiesEdgeProfileSubscriptionId = (string) content.GetValueForProperty("PropertiesEdgeProfileSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).PropertiesEdgeProfileSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionRegistrationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionRegistrationDate = (string) content.GetValueForProperty("SubscriptionRegistrationDate",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionRegistrationDate, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("QuotaId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).QuotaId = (string) content.GetValueForProperty("QuotaId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).QuotaId, global::System.Convert.ToString); + } + if (content.Contains("SerializedDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SerializedDetail = (string) content.GetValueForProperty("SerializedDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).SerializedDetail, global::System.Convert.ToString); + } + if (content.Contains("RegisteredFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).RegisteredFeature = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[]) content.GetValueForProperty("RegisteredFeature",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).RegisteredFeature, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionRegisteredFeaturesTypeConverter.ConvertFrom)); + } + if (content.Contains("LocationPlacementId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).LocationPlacementId = (string) content.GetValueForProperty("LocationPlacementId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal)this).LocationPlacementId, 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.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRole DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CloudEdgeManagementRole(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.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRole DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CloudEdgeManagementRole(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.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRole FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The preview of Virtual Machine Cloud Management from the Azure supports deploying and managing VMs on your Azure Stack + /// Edge device from Azure Portal. + /// For more information, refer to: https://docs.microsoft.com/en-us/azure/databox-online/azure-stack-edge-gpu-virtual-machine-overview + /// By using this feature, you agree to the preview legal terms. See the https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/ + /// for additional details. + [System.ComponentModel.TypeConverter(typeof(CloudEdgeManagementRoleTypeConverter))] + public partial interface ICloudEdgeManagementRole + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRole.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRole.TypeConverter.cs new file mode 100644 index 000000000000..a7d939970be5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRole.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CloudEdgeManagementRoleTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRole ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRole).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CloudEdgeManagementRole.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CloudEdgeManagementRole.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CloudEdgeManagementRole.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/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRole.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRole.cs new file mode 100644 index 000000000000..2e572e77cddf --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRole.cs @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// The preview of Virtual Machine Cloud Management from the Azure supports deploying and managing VMs on your Azure Stack + /// Edge device from Azure Portal. + /// For more information, refer to: https://docs.microsoft.com/en-us/azure/databox-online/azure-stack-edge-gpu-virtual-machine-overview + /// By using this feature, you agree to the preview legal terms. See the https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/ + /// for additional details. + /// + public partial class CloudEdgeManagementRole : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRole, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole __role = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Role(); + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Id; } + + /// Role type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).Kind = value ; } + + /// Local Edge Management Status + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? LocalManagementStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).LocalManagementStatus; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string LocationPlacementId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).LocationPlacementId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).LocationPlacementId = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Type = value; } + + /// Internal Acessors for EdgeProfile + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal.EdgeProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).EdgeProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).EdgeProfile = value; } + + /// Internal Acessors for EdgeProfileSubscription + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal.EdgeProfileSubscription { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).EdgeProfileSubscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).EdgeProfileSubscription = value; } + + /// Internal Acessors for LocalManagementStatus + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal.LocalManagementStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).LocalManagementStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).LocalManagementStatus = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudEdgeManagementRoleProperties()); set { {_property = value;} } } + + /// Internal Acessors for SubscriptionProperty + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleInternal.SubscriptionProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).SubscriptionProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).SubscriptionProperty = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemData = value; } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Name; } + + /// ARM ID of the subscription + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string PropertiesEdgeProfileSubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).Id = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleProperties _property; + + /// Properties specific to CloudEdgeManagementRole role. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudEdgeManagementRoleProperties()); set => this._property = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string QuotaId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).QuotaId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).QuotaId = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).RegisteredFeature; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).RegisteredFeature = value ?? null /* arrayOf */; } + + /// Role status. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? RoleStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).RoleStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).RoleStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SerializedDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).SerializedDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).SerializedDetail = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).SubscriptionId = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SubscriptionRegistrationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).SubscriptionRegistrationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).SubscriptionRegistrationDate = value ?? null; } + + /// Edge Subscription Registration ID + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SubscriptionRegistrationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).SubscriptionRegistrationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).SubscriptionRegistrationId = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState? SubscriptionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).SubscriptionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).SubscriptionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState)""); } + + /// Metadata pertaining to creation and last modification of Role + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)Property).TenantId = value ?? null; } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Type; } + + /// Creates an new instance. + public CloudEdgeManagementRole() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__role), __role); + await eventListener.AssertObjectIsValid(nameof(__role), __role); + } + } + /// The preview of Virtual Machine Cloud Management from the Azure supports deploying and managing VMs on your Azure Stack + /// Edge device from Azure Portal. + /// For more information, refer to: https://docs.microsoft.com/en-us/azure/databox-online/azure-stack-edge-gpu-virtual-machine-overview + /// By using this feature, you agree to the preview legal terms. See the https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/ + /// for additional details. + public partial interface ICloudEdgeManagementRole : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole + { + /// Local Edge Management Status + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Local Edge Management Status", + SerializedName = @"localManagementStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? LocalManagementStatus { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"locationPlacementId", + PossibleTypes = new [] { typeof(string) })] + string LocationPlacementId { get; set; } + /// ARM ID of the subscription + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ARM ID of the subscription", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string PropertiesEdgeProfileSubscriptionId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"quotaId", + PossibleTypes = new [] { typeof(string) })] + string QuotaId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"registeredFeatures", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get; set; } + /// Role status. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Role status.", + SerializedName = @"roleStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? RoleStatus { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"serializedDetails", + PossibleTypes = new [] { typeof(string) })] + string SerializedDetail { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"registrationDate", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionRegistrationDate { get; set; } + /// Edge Subscription Registration ID + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Edge Subscription Registration ID", + SerializedName = @"registrationId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionRegistrationId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState? SubscriptionState { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; set; } + + } + /// The preview of Virtual Machine Cloud Management from the Azure supports deploying and managing VMs on your Azure Stack + /// Edge device from Azure Portal. + /// For more information, refer to: https://docs.microsoft.com/en-us/azure/databox-online/azure-stack-edge-gpu-virtual-machine-overview + /// By using this feature, you agree to the preview legal terms. See the https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/ + /// for additional details. + internal partial interface ICloudEdgeManagementRoleInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal + { + /// Edge Profile of the resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile EdgeProfile { get; set; } + /// Edge Profile Subscription + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription EdgeProfileSubscription { get; set; } + /// Local Edge Management Status + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? LocalManagementStatus { get; set; } + + string LocationPlacementId { get; set; } + /// ARM ID of the subscription + string PropertiesEdgeProfileSubscriptionId { get; set; } + /// Properties specific to CloudEdgeManagementRole role. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleProperties Property { get; set; } + + string QuotaId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get; set; } + /// Role status. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? RoleStatus { get; set; } + + string SerializedDetail { get; set; } + + string SubscriptionId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties SubscriptionProperty { get; set; } + + string SubscriptionRegistrationDate { get; set; } + /// Edge Subscription Registration ID + string SubscriptionRegistrationId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState? SubscriptionState { get; set; } + + string TenantId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRole.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRole.json.cs new file mode 100644 index 000000000000..6a42779f7cc8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRole.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// The preview of Virtual Machine Cloud Management from the Azure supports deploying and managing VMs on your Azure Stack + /// Edge device from Azure Portal. + /// For more information, refer to: https://docs.microsoft.com/en-us/azure/databox-online/azure-stack-edge-gpu-virtual-machine-overview + /// By using this feature, you agree to the preview legal terms. See the https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/ + /// for additional details. + /// + public partial class CloudEdgeManagementRole + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal CloudEdgeManagementRole(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __role = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Role(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudEdgeManagementRoleProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRole. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRole. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRole FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new CloudEdgeManagementRole(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __role?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRoleProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRoleProperties.PowerShell.cs new file mode 100644 index 000000000000..e8b5c52c0897 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRoleProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// CloudEdgeManagement Role properties. + [System.ComponentModel.TypeConverter(typeof(CloudEdgeManagementRolePropertiesTypeConverter))] + public partial class CloudEdgeManagementRoleProperties + { + + /// + /// 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 CloudEdgeManagementRoleProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EdgeProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).EdgeProfile = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile) content.GetValueForProperty("EdgeProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).EdgeProfile, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileTypeConverter.ConvertFrom); + } + if (content.Contains("LocalManagementStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).LocalManagementStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus?) content.GetValueForProperty("LocalManagementStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).LocalManagementStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("RoleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).RoleStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) content.GetValueForProperty("RoleStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).RoleStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("EdgeProfileSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).EdgeProfileSubscription = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription) content.GetValueForProperty("EdgeProfileSubscription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).EdgeProfileSubscription, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionProperty = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties) content.GetValueForProperty("SubscriptionProperty",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionProperty, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState?) content.GetValueForProperty("SubscriptionState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState.CreateFrom); + } + if (content.Contains("SubscriptionRegistrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionRegistrationId = (string) content.GetValueForProperty("SubscriptionRegistrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionRegistrationId, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionRegistrationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionRegistrationDate = (string) content.GetValueForProperty("SubscriptionRegistrationDate",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionRegistrationDate, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("QuotaId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).QuotaId = (string) content.GetValueForProperty("QuotaId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).QuotaId, global::System.Convert.ToString); + } + if (content.Contains("SerializedDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SerializedDetail = (string) content.GetValueForProperty("SerializedDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SerializedDetail, global::System.Convert.ToString); + } + if (content.Contains("RegisteredFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).RegisteredFeature = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[]) content.GetValueForProperty("RegisteredFeature",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).RegisteredFeature, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionRegisteredFeaturesTypeConverter.ConvertFrom)); + } + if (content.Contains("LocationPlacementId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).LocationPlacementId = (string) content.GetValueForProperty("LocationPlacementId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).LocationPlacementId, 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 CloudEdgeManagementRoleProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EdgeProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).EdgeProfile = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile) content.GetValueForProperty("EdgeProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).EdgeProfile, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileTypeConverter.ConvertFrom); + } + if (content.Contains("LocalManagementStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).LocalManagementStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus?) content.GetValueForProperty("LocalManagementStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).LocalManagementStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("RoleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).RoleStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) content.GetValueForProperty("RoleStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).RoleStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("EdgeProfileSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).EdgeProfileSubscription = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription) content.GetValueForProperty("EdgeProfileSubscription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).EdgeProfileSubscription, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionProperty = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties) content.GetValueForProperty("SubscriptionProperty",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionProperty, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState?) content.GetValueForProperty("SubscriptionState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState.CreateFrom); + } + if (content.Contains("SubscriptionRegistrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionRegistrationId = (string) content.GetValueForProperty("SubscriptionRegistrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionRegistrationId, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionRegistrationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionRegistrationDate = (string) content.GetValueForProperty("SubscriptionRegistrationDate",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionRegistrationDate, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("QuotaId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).QuotaId = (string) content.GetValueForProperty("QuotaId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).QuotaId, global::System.Convert.ToString); + } + if (content.Contains("SerializedDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SerializedDetail = (string) content.GetValueForProperty("SerializedDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).SerializedDetail, global::System.Convert.ToString); + } + if (content.Contains("RegisteredFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).RegisteredFeature = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[]) content.GetValueForProperty("RegisteredFeature",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).RegisteredFeature, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionRegisteredFeaturesTypeConverter.ConvertFrom)); + } + if (content.Contains("LocationPlacementId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).LocationPlacementId = (string) content.GetValueForProperty("LocationPlacementId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal)this).LocationPlacementId, 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.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CloudEdgeManagementRoleProperties(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.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CloudEdgeManagementRoleProperties(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.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// CloudEdgeManagement Role properties. + [System.ComponentModel.TypeConverter(typeof(CloudEdgeManagementRolePropertiesTypeConverter))] + public partial interface ICloudEdgeManagementRoleProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRoleProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRoleProperties.TypeConverter.cs new file mode 100644 index 000000000000..0527ab35484a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRoleProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CloudEdgeManagementRolePropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CloudEdgeManagementRoleProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CloudEdgeManagementRoleProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CloudEdgeManagementRoleProperties.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/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRoleProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRoleProperties.cs new file mode 100644 index 000000000000..0100a64c42fa --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRoleProperties.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// CloudEdgeManagement Role properties. + public partial class CloudEdgeManagementRoleProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile _edgeProfile; + + /// Edge Profile of the resource + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile EdgeProfile { get => (this._edgeProfile = this._edgeProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfile()); } + + /// ARM ID of the subscription + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).Id = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? _localManagementStatus; + + /// Local Edge Management Status + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? LocalManagementStatus { get => this._localManagementStatus; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string LocationPlacementId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).LocationPlacementId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).LocationPlacementId = value ?? null; } + + /// Internal Acessors for EdgeProfile + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal.EdgeProfile { get => (this._edgeProfile = this._edgeProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfile()); set { {_edgeProfile = value;} } } + + /// Internal Acessors for EdgeProfileSubscription + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal.EdgeProfileSubscription { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).Subscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).Subscription = value; } + + /// Internal Acessors for LocalManagementStatus + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal.LocalManagementStatus { get => this._localManagementStatus; set { {_localManagementStatus = value;} } } + + /// Internal Acessors for SubscriptionProperty + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRolePropertiesInternal.SubscriptionProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionProperty = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string QuotaId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).QuotaId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).QuotaId = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).RegisteredFeature; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).RegisteredFeature = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus _roleStatus; + + /// Role status. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus RoleStatus { get => this._roleStatus; set => this._roleStatus = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SerializedDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SerializedDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SerializedDetail = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionId = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SubscriptionRegistrationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionRegistrationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionRegistrationDate = value ?? null; } + + /// Edge Subscription Registration ID + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SubscriptionRegistrationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionRegistrationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionRegistrationId = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState? SubscriptionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).TenantId = value ?? null; } + + /// Creates an new instance. + public CloudEdgeManagementRoleProperties() + { + + } + } + /// CloudEdgeManagement Role properties. + public partial interface ICloudEdgeManagementRoleProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// ARM ID of the subscription + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ARM ID of the subscription", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Local Edge Management Status + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Local Edge Management Status", + SerializedName = @"localManagementStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? LocalManagementStatus { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"locationPlacementId", + PossibleTypes = new [] { typeof(string) })] + string LocationPlacementId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"quotaId", + PossibleTypes = new [] { typeof(string) })] + string QuotaId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"registeredFeatures", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get; set; } + /// Role status. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Role status.", + SerializedName = @"roleStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus RoleStatus { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"serializedDetails", + PossibleTypes = new [] { typeof(string) })] + string SerializedDetail { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"registrationDate", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionRegistrationDate { get; set; } + /// Edge Subscription Registration ID + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Edge Subscription Registration ID", + SerializedName = @"registrationId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionRegistrationId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState? SubscriptionState { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; set; } + + } + /// CloudEdgeManagement Role properties. + internal partial interface ICloudEdgeManagementRolePropertiesInternal + + { + /// Edge Profile of the resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile EdgeProfile { get; set; } + /// Edge Profile Subscription + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription EdgeProfileSubscription { get; set; } + /// ARM ID of the subscription + string Id { get; set; } + /// Local Edge Management Status + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? LocalManagementStatus { get; set; } + + string LocationPlacementId { get; set; } + + string QuotaId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get; set; } + /// Role status. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus RoleStatus { get; set; } + + string SerializedDetail { get; set; } + + string SubscriptionId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties SubscriptionProperty { get; set; } + + string SubscriptionRegistrationDate { get; set; } + /// Edge Subscription Registration ID + string SubscriptionRegistrationId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState? SubscriptionState { get; set; } + + string TenantId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRoleProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRoleProperties.json.cs new file mode 100644 index 000000000000..2f604607a844 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudEdgeManagementRoleProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// CloudEdgeManagement Role properties. + public partial class CloudEdgeManagementRoleProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal CloudEdgeManagementRoleProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_edgeProfile = If( json?.PropertyT("edgeProfile"), out var __jsonEdgeProfile) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfile.FromJson(__jsonEdgeProfile) : EdgeProfile;} + {_localManagementStatus = If( json?.PropertyT("localManagementStatus"), out var __jsonLocalManagementStatus) ? (string)__jsonLocalManagementStatus : (string)LocalManagementStatus;} + {_roleStatus = If( json?.PropertyT("roleStatus"), out var __jsonRoleStatus) ? (string)__jsonRoleStatus : (string)RoleStatus;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudEdgeManagementRoleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new CloudEdgeManagementRoleProperties(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._edgeProfile ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._edgeProfile.ToJson(null,serializationMode) : null, "edgeProfile" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._localManagementStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._localManagementStatus.ToString()) : null, "localManagementStatus" ,container.Add ); + } + AddIf( null != (((object)this._roleStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._roleStatus.ToString()) : null, "roleStatus" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudError.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudError.PowerShell.cs new file mode 100644 index 000000000000..912bdf10e6f3 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudError.PowerShell.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// An error response from the service. + [System.ComponentModel.TypeConverter(typeof(CloudErrorTypeConverter))] + public partial class CloudError + { + + /// + /// 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 CloudError(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.DataBoxEdge.Models.Api20220301.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudErrorBodyTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudErrorBodyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CloudError(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.DataBoxEdge.Models.Api20220301.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudErrorBodyTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudErrorBodyTypeConverter.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.DataBoxEdge.Models.Api20220301.ICloudError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CloudError(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.DataBoxEdge.Models.Api20220301.ICloudError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CloudError(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.DataBoxEdge.Models.Api20220301.ICloudError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An error response from the service. + [System.ComponentModel.TypeConverter(typeof(CloudErrorTypeConverter))] + public partial interface ICloudError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudError.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudError.TypeConverter.cs new file mode 100644 index 000000000000..ed9a058cfe04 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudError.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CloudErrorTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ICloudError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CloudError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CloudError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CloudError.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/databoxedge/generated/api/Models/Api20220301/CloudError.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudError.cs new file mode 100644 index 000000000000..9d5a5dff5fca --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudError.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// An error response from the service. + public partial class CloudError : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudError, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorInternal + { + + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBodyInternal)Error).Code = value ?? null; } + + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBodyInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBodyInternal)Error).Detail = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody _error; + + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudErrorBody()); set => this._error = value; } + + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBodyInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudErrorBody()); set { {_error = value;} } } + + /// Creates an new instance. + public CloudError() + { + + } + } + /// An error response from the service. + public partial interface ICloudError : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An identifier for the error. Codes are invariant and are intended to be consumed programmatically.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of additional details about the error.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody[] Detail { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message describing the error, intended to be suitable for display in a user interface.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + + } + /// An error response from the service. + internal partial interface ICloudErrorInternal + + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + string Code { get; set; } + /// A list of additional details about the error. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody[] Detail { get; set; } + /// The error details. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody Error { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudError.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudError.json.cs new file mode 100644 index 000000000000..4794dfc611f2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudError.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// An error response from the service. + public partial class CloudError + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal CloudError(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudErrorBody.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudError FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new CloudError(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudErrorBody.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudErrorBody.PowerShell.cs new file mode 100644 index 000000000000..992c5c9a5bb0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudErrorBody.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// An error response from the service. + [System.ComponentModel.TypeConverter(typeof(CloudErrorBodyTypeConverter))] + public partial class CloudErrorBody + { + + /// + /// 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 CloudErrorBody(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBodyInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBodyInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBodyInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBodyInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudErrorBodyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CloudErrorBody(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBodyInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBodyInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBodyInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBodyInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudErrorBodyTypeConverter.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.DataBoxEdge.Models.Api20220301.ICloudErrorBody DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CloudErrorBody(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.DataBoxEdge.Models.Api20220301.ICloudErrorBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CloudErrorBody(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.DataBoxEdge.Models.Api20220301.ICloudErrorBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An error response from the service. + [System.ComponentModel.TypeConverter(typeof(CloudErrorBodyTypeConverter))] + public partial interface ICloudErrorBody + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudErrorBody.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudErrorBody.TypeConverter.cs new file mode 100644 index 000000000000..b299ed968cb1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudErrorBody.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CloudErrorBodyTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ICloudErrorBody ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CloudErrorBody.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CloudErrorBody.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CloudErrorBody.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/databoxedge/generated/api/Models/Api20220301/CloudErrorBody.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudErrorBody.cs new file mode 100644 index 000000000000..955f9fda8b61 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudErrorBody.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// An error response from the service. + public partial class CloudErrorBody : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBodyInternal + { + + /// Backing field for property. + private string _code; + + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody[] _detail; + + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody[] Detail { get => this._detail; set => this._detail = value; } + + /// Backing field for property. + private string _message; + + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Creates an new instance. + public CloudErrorBody() + { + + } + } + /// An error response from the service. + public partial interface ICloudErrorBody : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An identifier for the error. Codes are invariant and are intended to be consumed programmatically.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of additional details about the error.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody[] Detail { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message describing the error, intended to be suitable for display in a user interface.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + + } + /// An error response from the service. + internal partial interface ICloudErrorBodyInternal + + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + string Code { get; set; } + /// A list of additional details about the error. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody[] Detail { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudErrorBody.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudErrorBody.json.cs new file mode 100644 index 000000000000..edc4f77d8237 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CloudErrorBody.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// An error response from the service. + public partial class CloudErrorBody + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal CloudErrorBody(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.ICloudErrorBody) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CloudErrorBody.FromJson(__u) )) ))() : null : Detail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICloudErrorBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new CloudErrorBody(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + if (null != this._detail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._detail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("details",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterCapacityViewData.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterCapacityViewData.PowerShell.cs new file mode 100644 index 000000000000..f8bd1566b152 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterCapacityViewData.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Cluster Compute Data. + [System.ComponentModel.TypeConverter(typeof(ClusterCapacityViewDataTypeConverter))] + public partial class ClusterCapacityViewData + { + + /// + /// 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 ClusterCapacityViewData(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("GpuCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity) content.GetValueForProperty("GpuCapacity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterGpuCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("MemoryCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity) content.GetValueForProperty("MemoryCapacity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterMemoryCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("Fqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).Fqdn = (string) content.GetValueForProperty("Fqdn",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).Fqdn, global::System.Convert.ToString); + } + if (content.Contains("LastRefreshedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).LastRefreshedTime = (global::System.DateTime?) content.GetValueForProperty("LastRefreshedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).LastRefreshedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TotalProvisionedNonHpnCore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).TotalProvisionedNonHpnCore = (long?) content.GetValueForProperty("TotalProvisionedNonHpnCore",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).TotalProvisionedNonHpnCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("GpuCapacityGpuType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuType = (string) content.GetValueForProperty("GpuCapacityGpuType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuType, global::System.Convert.ToString); + } + if (content.Contains("GpuCapacityGpuUsedUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuUsedUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuUsedUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuUsedUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuCapacityGpuFreeUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuFreeUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuFreeUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuFreeUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuCapacityGpuReservedForFailoverUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuReservedForFailoverUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuReservedForFailoverUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuReservedForFailoverUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuCapacityGpuTotalUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuTotalUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuTotalUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuTotalUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MemoryCapacityClusterFreeMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterFreeMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterFreeMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterFreeMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterUsedMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterUsedMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterUsedMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterUsedMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterFailoverMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterFailoverMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterFailoverMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterFailoverMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterFragmentationMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterFragmentationMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterFragmentationMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterFragmentationMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterHypervReserveMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterHypervReserveMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterHypervReserveMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterHypervReserveMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterInfraVMMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterInfraVMMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterInfraVMMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterInfraVMMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterTotalMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterTotalMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterTotalMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterTotalMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterNonFailoverVMMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterNonFailoverVMMb = (double?) content.GetValueForProperty("MemoryCapacityClusterNonFailoverVMMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterNonFailoverVMMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterMemoryUsedByVmsMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterMemoryUsedByVmsMb = (double?) content.GetValueForProperty("MemoryCapacityClusterMemoryUsedByVmsMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterMemoryUsedByVmsMb, (__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 ClusterCapacityViewData(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("GpuCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity) content.GetValueForProperty("GpuCapacity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterGpuCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("MemoryCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity) content.GetValueForProperty("MemoryCapacity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterMemoryCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("Fqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).Fqdn = (string) content.GetValueForProperty("Fqdn",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).Fqdn, global::System.Convert.ToString); + } + if (content.Contains("LastRefreshedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).LastRefreshedTime = (global::System.DateTime?) content.GetValueForProperty("LastRefreshedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).LastRefreshedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TotalProvisionedNonHpnCore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).TotalProvisionedNonHpnCore = (long?) content.GetValueForProperty("TotalProvisionedNonHpnCore",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).TotalProvisionedNonHpnCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("GpuCapacityGpuType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuType = (string) content.GetValueForProperty("GpuCapacityGpuType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuType, global::System.Convert.ToString); + } + if (content.Contains("GpuCapacityGpuUsedUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuUsedUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuUsedUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuUsedUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuCapacityGpuFreeUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuFreeUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuFreeUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuFreeUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuCapacityGpuReservedForFailoverUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuReservedForFailoverUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuReservedForFailoverUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuReservedForFailoverUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuCapacityGpuTotalUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuTotalUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuTotalUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).GpuCapacityGpuTotalUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MemoryCapacityClusterFreeMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterFreeMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterFreeMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterFreeMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterUsedMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterUsedMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterUsedMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterUsedMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterFailoverMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterFailoverMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterFailoverMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterFailoverMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterFragmentationMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterFragmentationMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterFragmentationMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterFragmentationMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterHypervReserveMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterHypervReserveMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterHypervReserveMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterHypervReserveMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterInfraVMMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterInfraVMMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterInfraVMMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterInfraVMMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterTotalMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterTotalMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterTotalMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterTotalMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterNonFailoverVMMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterNonFailoverVMMb = (double?) content.GetValueForProperty("MemoryCapacityClusterNonFailoverVMMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterNonFailoverVMMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterMemoryUsedByVmsMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterMemoryUsedByVmsMb = (double?) content.GetValueForProperty("MemoryCapacityClusterMemoryUsedByVmsMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)this).MemoryCapacityClusterMemoryUsedByVmsMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + 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.DataBoxEdge.Models.Api20220301.IClusterCapacityViewData DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClusterCapacityViewData(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.DataBoxEdge.Models.Api20220301.IClusterCapacityViewData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClusterCapacityViewData(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.DataBoxEdge.Models.Api20220301.IClusterCapacityViewData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Cluster Compute Data. + [System.ComponentModel.TypeConverter(typeof(ClusterCapacityViewDataTypeConverter))] + public partial interface IClusterCapacityViewData + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterCapacityViewData.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterCapacityViewData.TypeConverter.cs new file mode 100644 index 000000000000..93870c17afe1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterCapacityViewData.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ClusterCapacityViewDataTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IClusterCapacityViewData ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewData).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ClusterCapacityViewData.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ClusterCapacityViewData.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ClusterCapacityViewData.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/databoxedge/generated/api/Models/Api20220301/ClusterCapacityViewData.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterCapacityViewData.cs new file mode 100644 index 000000000000..fd0be1a41974 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterCapacityViewData.cs @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Cluster Compute Data. + public partial class ClusterCapacityViewData : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewData, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal + { + + /// Backing field for property. + private string _fqdn; + + /// The FQDN of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Fqdn { get => this._fqdn; set => this._fqdn = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity _gpuCapacity; + + /// The cluster's GPU capacity. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity GpuCapacity { get => (this._gpuCapacity = this._gpuCapacity ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterGpuCapacity()); set => this._gpuCapacity = value; } + + /// The free GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? GpuCapacityGpuFreeUnitsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)GpuCapacity).GpuFreeUnitsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)GpuCapacity).GpuFreeUnitsCount = value ?? default(int); } + + /// The GPU units count reserved for failover in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? GpuCapacityGpuReservedForFailoverUnitsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)GpuCapacity).GpuReservedForFailoverUnitsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)GpuCapacity).GpuReservedForFailoverUnitsCount = value ?? default(int); } + + /// The total GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? GpuCapacityGpuTotalUnitsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)GpuCapacity).GpuTotalUnitsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)GpuCapacity).GpuTotalUnitsCount = value ?? default(int); } + + /// The cluster GPU Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string GpuCapacityGpuType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)GpuCapacity).GpuType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)GpuCapacity).GpuType = value ?? null; } + + /// The used GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? GpuCapacityGpuUsedUnitsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)GpuCapacity).GpuUsedUnitsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)GpuCapacity).GpuUsedUnitsCount = value ?? default(int); } + + /// Backing field for property. + private global::System.DateTime? _lastRefreshedTime; + + /// The last time at which the ClusterCapacityViewData was set. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? LastRefreshedTime { get => this._lastRefreshedTime; set => this._lastRefreshedTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity _memoryCapacity; + + /// The cluster's memory capacity. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity MemoryCapacity { get => (this._memoryCapacity = this._memoryCapacity ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterMemoryCapacity()); set => this._memoryCapacity = value; } + + /// The failover memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterFailoverMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)MemoryCapacity).ClusterFailoverMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)MemoryCapacity).ClusterFailoverMemoryMb = value ?? default(double); } + + /// The fragmentation memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterFragmentationMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)MemoryCapacity).ClusterFragmentationMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)MemoryCapacity).ClusterFragmentationMemoryMb = value ?? default(double); } + + /// The free memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterFreeMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)MemoryCapacity).ClusterFreeMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)MemoryCapacity).ClusterFreeMemoryMb = value ?? default(double); } + + /// The memory reserved for Hyper-V in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterHypervReserveMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)MemoryCapacity).ClusterHypervReserveMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)MemoryCapacity).ClusterHypervReserveMemoryMb = value ?? default(double); } + + /// The memory of the Infra VM in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterInfraVMMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)MemoryCapacity).ClusterInfraVMMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)MemoryCapacity).ClusterInfraVMMemoryMb = value ?? default(double); } + + /// The memory used by VMs in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterMemoryUsedByVmsMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)MemoryCapacity).ClusterMemoryUsedByVmsMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)MemoryCapacity).ClusterMemoryUsedByVmsMb = value ?? default(double); } + + /// The non-failover memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterNonFailoverVMMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)MemoryCapacity).ClusterNonFailoverVMMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)MemoryCapacity).ClusterNonFailoverVMMb = value ?? default(double); } + + /// The total memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterTotalMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)MemoryCapacity).ClusterTotalMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)MemoryCapacity).ClusterTotalMemoryMb = value ?? default(double); } + + /// The used memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterUsedMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)MemoryCapacity).ClusterUsedMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)MemoryCapacity).ClusterUsedMemoryMb = value ?? default(double); } + + /// Internal Acessors for GpuCapacity + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal.GpuCapacity { get => (this._gpuCapacity = this._gpuCapacity ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterGpuCapacity()); set { {_gpuCapacity = value;} } } + + /// Internal Acessors for MemoryCapacity + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal.MemoryCapacity { get => (this._memoryCapacity = this._memoryCapacity ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterMemoryCapacity()); set { {_memoryCapacity = value;} } } + + /// Backing field for property. + private long? _totalProvisionedNonHpnCore; + + /// The total # of vCPUs provisioned by non-HPN VM per appliance. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public long? TotalProvisionedNonHpnCore { get => this._totalProvisionedNonHpnCore; set => this._totalProvisionedNonHpnCore = value; } + + /// Creates an new instance. + public ClusterCapacityViewData() + { + + } + } + /// Cluster Compute Data. + public partial interface IClusterCapacityViewData : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The FQDN of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The FQDN of the cluster.", + SerializedName = @"fqdn", + PossibleTypes = new [] { typeof(string) })] + string Fqdn { get; set; } + /// The free GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The free GPU units count in the cluster.", + SerializedName = @"gpuFreeUnitsCount", + PossibleTypes = new [] { typeof(int) })] + int? GpuCapacityGpuFreeUnitsCount { get; set; } + /// The GPU units count reserved for failover in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The GPU units count reserved for failover in the cluster.", + SerializedName = @"gpuReservedForFailoverUnitsCount", + PossibleTypes = new [] { typeof(int) })] + int? GpuCapacityGpuReservedForFailoverUnitsCount { get; set; } + /// The total GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total GPU units count in the cluster.", + SerializedName = @"gpuTotalUnitsCount", + PossibleTypes = new [] { typeof(int) })] + int? GpuCapacityGpuTotalUnitsCount { get; set; } + /// The cluster GPU Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The cluster GPU Type.", + SerializedName = @"gpuType", + PossibleTypes = new [] { typeof(string) })] + string GpuCapacityGpuType { get; set; } + /// The used GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The used GPU units count in the cluster.", + SerializedName = @"gpuUsedUnitsCount", + PossibleTypes = new [] { typeof(int) })] + int? GpuCapacityGpuUsedUnitsCount { get; set; } + /// The last time at which the ClusterCapacityViewData was set. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The last time at which the ClusterCapacityViewData was set.", + SerializedName = @"lastRefreshedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastRefreshedTime { get; set; } + /// The failover memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The failover memory in the cluster in MB.", + SerializedName = @"clusterFailoverMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterFailoverMemoryMb { get; set; } + /// The fragmentation memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The fragmentation memory in the cluster in MB.", + SerializedName = @"clusterFragmentationMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterFragmentationMemoryMb { get; set; } + /// The free memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The free memory in the cluster in MB.", + SerializedName = @"clusterFreeMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterFreeMemoryMb { get; set; } + /// The memory reserved for Hyper-V in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The memory reserved for Hyper-V in the cluster in MB.", + SerializedName = @"clusterHypervReserveMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterHypervReserveMemoryMb { get; set; } + /// The memory of the Infra VM in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The memory of the Infra VM in the cluster in MB.", + SerializedName = @"clusterInfraVmMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterInfraVMMemoryMb { get; set; } + /// The memory used by VMs in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The memory used by VMs in the cluster in MB.", + SerializedName = @"clusterMemoryUsedByVmsMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterMemoryUsedByVmsMb { get; set; } + /// The non-failover memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The non-failover memory in the cluster in MB.", + SerializedName = @"clusterNonFailoverVmMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterNonFailoverVMMb { get; set; } + /// The total memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total memory in the cluster in MB.", + SerializedName = @"clusterTotalMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterTotalMemoryMb { get; set; } + /// The used memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The used memory in the cluster in MB.", + SerializedName = @"clusterUsedMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterUsedMemoryMb { get; set; } + /// The total # of vCPUs provisioned by non-HPN VM per appliance. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total # of vCPUs provisioned by non-HPN VM per appliance.", + SerializedName = @"totalProvisionedNonHpnCores", + PossibleTypes = new [] { typeof(long) })] + long? TotalProvisionedNonHpnCore { get; set; } + + } + /// Cluster Compute Data. + internal partial interface IClusterCapacityViewDataInternal + + { + /// The FQDN of the cluster. + string Fqdn { get; set; } + /// The cluster's GPU capacity. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity GpuCapacity { get; set; } + /// The free GPU units count in the cluster. + int? GpuCapacityGpuFreeUnitsCount { get; set; } + /// The GPU units count reserved for failover in the cluster. + int? GpuCapacityGpuReservedForFailoverUnitsCount { get; set; } + /// The total GPU units count in the cluster. + int? GpuCapacityGpuTotalUnitsCount { get; set; } + /// The cluster GPU Type. + string GpuCapacityGpuType { get; set; } + /// The used GPU units count in the cluster. + int? GpuCapacityGpuUsedUnitsCount { get; set; } + /// The last time at which the ClusterCapacityViewData was set. + global::System.DateTime? LastRefreshedTime { get; set; } + /// The cluster's memory capacity. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity MemoryCapacity { get; set; } + /// The failover memory in the cluster in MB. + double? MemoryCapacityClusterFailoverMemoryMb { get; set; } + /// The fragmentation memory in the cluster in MB. + double? MemoryCapacityClusterFragmentationMemoryMb { get; set; } + /// The free memory in the cluster in MB. + double? MemoryCapacityClusterFreeMemoryMb { get; set; } + /// The memory reserved for Hyper-V in the cluster in MB. + double? MemoryCapacityClusterHypervReserveMemoryMb { get; set; } + /// The memory of the Infra VM in the cluster in MB. + double? MemoryCapacityClusterInfraVMMemoryMb { get; set; } + /// The memory used by VMs in the cluster in MB. + double? MemoryCapacityClusterMemoryUsedByVmsMb { get; set; } + /// The non-failover memory in the cluster in MB. + double? MemoryCapacityClusterNonFailoverVMMb { get; set; } + /// The total memory in the cluster in MB. + double? MemoryCapacityClusterTotalMemoryMb { get; set; } + /// The used memory in the cluster in MB. + double? MemoryCapacityClusterUsedMemoryMb { get; set; } + /// The total # of vCPUs provisioned by non-HPN VM per appliance. + long? TotalProvisionedNonHpnCore { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterCapacityViewData.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterCapacityViewData.json.cs new file mode 100644 index 000000000000..e6a69f43f682 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterCapacityViewData.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Cluster Compute Data. + public partial class ClusterCapacityViewData + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ClusterCapacityViewData(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_gpuCapacity = If( json?.PropertyT("gpuCapacity"), out var __jsonGpuCapacity) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterGpuCapacity.FromJson(__jsonGpuCapacity) : GpuCapacity;} + {_memoryCapacity = If( json?.PropertyT("memoryCapacity"), out var __jsonMemoryCapacity) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterMemoryCapacity.FromJson(__jsonMemoryCapacity) : MemoryCapacity;} + {_fqdn = If( json?.PropertyT("fqdn"), out var __jsonFqdn) ? (string)__jsonFqdn : (string)Fqdn;} + {_lastRefreshedTime = If( json?.PropertyT("lastRefreshedTime"), out var __jsonLastRefreshedTime) ? global::System.DateTime.TryParse((string)__jsonLastRefreshedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastRefreshedTimeValue) ? __jsonLastRefreshedTimeValue : LastRefreshedTime : LastRefreshedTime;} + {_totalProvisionedNonHpnCore = If( json?.PropertyT("totalProvisionedNonHpnCores"), out var __jsonTotalProvisionedNonHpnCores) ? (long?)__jsonTotalProvisionedNonHpnCores : TotalProvisionedNonHpnCore;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewData. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewData. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewData FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ClusterCapacityViewData(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._gpuCapacity ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._gpuCapacity.ToJson(null,serializationMode) : null, "gpuCapacity" ,container.Add ); + AddIf( null != this._memoryCapacity ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._memoryCapacity.ToJson(null,serializationMode) : null, "memoryCapacity" ,container.Add ); + AddIf( null != (((object)this._fqdn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._fqdn.ToString()) : null, "fqdn" ,container.Add ); + AddIf( null != this._lastRefreshedTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._lastRefreshedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastRefreshedTime" ,container.Add ); + AddIf( null != this._totalProvisionedNonHpnCore ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((long)this._totalProvisionedNonHpnCore) : null, "totalProvisionedNonHpnCores" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterGpuCapacity.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterGpuCapacity.PowerShell.cs new file mode 100644 index 000000000000..01ea1584f1c9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterGpuCapacity.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Cluster GPU Data. + [System.ComponentModel.TypeConverter(typeof(ClusterGpuCapacityTypeConverter))] + public partial class ClusterGpuCapacity + { + + /// + /// 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 ClusterGpuCapacity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("GpuType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuType = (string) content.GetValueForProperty("GpuType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuType, global::System.Convert.ToString); + } + if (content.Contains("GpuUsedUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuUsedUnitsCount = (int?) content.GetValueForProperty("GpuUsedUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuUsedUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuFreeUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuFreeUnitsCount = (int?) content.GetValueForProperty("GpuFreeUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuFreeUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuReservedForFailoverUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuReservedForFailoverUnitsCount = (int?) content.GetValueForProperty("GpuReservedForFailoverUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuReservedForFailoverUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuTotalUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuTotalUnitsCount = (int?) content.GetValueForProperty("GpuTotalUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuTotalUnitsCount, (__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 ClusterGpuCapacity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("GpuType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuType = (string) content.GetValueForProperty("GpuType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuType, global::System.Convert.ToString); + } + if (content.Contains("GpuUsedUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuUsedUnitsCount = (int?) content.GetValueForProperty("GpuUsedUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuUsedUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuFreeUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuFreeUnitsCount = (int?) content.GetValueForProperty("GpuFreeUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuFreeUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuReservedForFailoverUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuReservedForFailoverUnitsCount = (int?) content.GetValueForProperty("GpuReservedForFailoverUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuReservedForFailoverUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuTotalUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuTotalUnitsCount = (int?) content.GetValueForProperty("GpuTotalUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal)this).GpuTotalUnitsCount, (__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.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClusterGpuCapacity(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.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClusterGpuCapacity(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.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Cluster GPU Data. + [System.ComponentModel.TypeConverter(typeof(ClusterGpuCapacityTypeConverter))] + public partial interface IClusterGpuCapacity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterGpuCapacity.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterGpuCapacity.TypeConverter.cs new file mode 100644 index 000000000000..855f4eb0da34 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterGpuCapacity.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ClusterGpuCapacityTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ClusterGpuCapacity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ClusterGpuCapacity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ClusterGpuCapacity.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/databoxedge/generated/api/Models/Api20220301/ClusterGpuCapacity.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterGpuCapacity.cs new file mode 100644 index 000000000000..c65ecd060ec1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterGpuCapacity.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Cluster GPU Data. + public partial class ClusterGpuCapacity : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacityInternal + { + + /// Backing field for property. + private int? _gpuFreeUnitsCount; + + /// The free GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? GpuFreeUnitsCount { get => this._gpuFreeUnitsCount; set => this._gpuFreeUnitsCount = value; } + + /// Backing field for property. + private int? _gpuReservedForFailoverUnitsCount; + + /// The GPU units count reserved for failover in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? GpuReservedForFailoverUnitsCount { get => this._gpuReservedForFailoverUnitsCount; set => this._gpuReservedForFailoverUnitsCount = value; } + + /// Backing field for property. + private int? _gpuTotalUnitsCount; + + /// The total GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? GpuTotalUnitsCount { get => this._gpuTotalUnitsCount; set => this._gpuTotalUnitsCount = value; } + + /// Backing field for property. + private string _gpuType; + + /// The cluster GPU Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string GpuType { get => this._gpuType; set => this._gpuType = value; } + + /// Backing field for property. + private int? _gpuUsedUnitsCount; + + /// The used GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? GpuUsedUnitsCount { get => this._gpuUsedUnitsCount; set => this._gpuUsedUnitsCount = value; } + + /// Creates an new instance. + public ClusterGpuCapacity() + { + + } + } + /// Cluster GPU Data. + public partial interface IClusterGpuCapacity : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The free GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The free GPU units count in the cluster.", + SerializedName = @"gpuFreeUnitsCount", + PossibleTypes = new [] { typeof(int) })] + int? GpuFreeUnitsCount { get; set; } + /// The GPU units count reserved for failover in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The GPU units count reserved for failover in the cluster.", + SerializedName = @"gpuReservedForFailoverUnitsCount", + PossibleTypes = new [] { typeof(int) })] + int? GpuReservedForFailoverUnitsCount { get; set; } + /// The total GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total GPU units count in the cluster.", + SerializedName = @"gpuTotalUnitsCount", + PossibleTypes = new [] { typeof(int) })] + int? GpuTotalUnitsCount { get; set; } + /// The cluster GPU Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The cluster GPU Type.", + SerializedName = @"gpuType", + PossibleTypes = new [] { typeof(string) })] + string GpuType { get; set; } + /// The used GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The used GPU units count in the cluster.", + SerializedName = @"gpuUsedUnitsCount", + PossibleTypes = new [] { typeof(int) })] + int? GpuUsedUnitsCount { get; set; } + + } + /// Cluster GPU Data. + internal partial interface IClusterGpuCapacityInternal + + { + /// The free GPU units count in the cluster. + int? GpuFreeUnitsCount { get; set; } + /// The GPU units count reserved for failover in the cluster. + int? GpuReservedForFailoverUnitsCount { get; set; } + /// The total GPU units count in the cluster. + int? GpuTotalUnitsCount { get; set; } + /// The cluster GPU Type. + string GpuType { get; set; } + /// The used GPU units count in the cluster. + int? GpuUsedUnitsCount { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterGpuCapacity.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterGpuCapacity.json.cs new file mode 100644 index 000000000000..fb3d06c8ddec --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterGpuCapacity.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Cluster GPU Data. + public partial class ClusterGpuCapacity + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ClusterGpuCapacity(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_gpuType = If( json?.PropertyT("gpuType"), out var __jsonGpuType) ? (string)__jsonGpuType : (string)GpuType;} + {_gpuUsedUnitsCount = If( json?.PropertyT("gpuUsedUnitsCount"), out var __jsonGpuUsedUnitsCount) ? (int?)__jsonGpuUsedUnitsCount : GpuUsedUnitsCount;} + {_gpuFreeUnitsCount = If( json?.PropertyT("gpuFreeUnitsCount"), out var __jsonGpuFreeUnitsCount) ? (int?)__jsonGpuFreeUnitsCount : GpuFreeUnitsCount;} + {_gpuReservedForFailoverUnitsCount = If( json?.PropertyT("gpuReservedForFailoverUnitsCount"), out var __jsonGpuReservedForFailoverUnitsCount) ? (int?)__jsonGpuReservedForFailoverUnitsCount : GpuReservedForFailoverUnitsCount;} + {_gpuTotalUnitsCount = If( json?.PropertyT("gpuTotalUnitsCount"), out var __jsonGpuTotalUnitsCount) ? (int?)__jsonGpuTotalUnitsCount : GpuTotalUnitsCount;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ClusterGpuCapacity(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._gpuType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._gpuType.ToString()) : null, "gpuType" ,container.Add ); + AddIf( null != this._gpuUsedUnitsCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._gpuUsedUnitsCount) : null, "gpuUsedUnitsCount" ,container.Add ); + AddIf( null != this._gpuFreeUnitsCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._gpuFreeUnitsCount) : null, "gpuFreeUnitsCount" ,container.Add ); + AddIf( null != this._gpuReservedForFailoverUnitsCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._gpuReservedForFailoverUnitsCount) : null, "gpuReservedForFailoverUnitsCount" ,container.Add ); + AddIf( null != this._gpuTotalUnitsCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._gpuTotalUnitsCount) : null, "gpuTotalUnitsCount" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterMemoryCapacity.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterMemoryCapacity.PowerShell.cs new file mode 100644 index 000000000000..6c255093a9d5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterMemoryCapacity.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// NodeCapacityInfo defines the required information to determine the placement of a VM. + /// + [System.ComponentModel.TypeConverter(typeof(ClusterMemoryCapacityTypeConverter))] + public partial class ClusterMemoryCapacity + { + + /// + /// 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 ClusterMemoryCapacity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ClusterFreeMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterFreeMemoryMb = (double?) content.GetValueForProperty("ClusterFreeMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterFreeMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterUsedMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterUsedMemoryMb = (double?) content.GetValueForProperty("ClusterUsedMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterUsedMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterFailoverMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterFailoverMemoryMb = (double?) content.GetValueForProperty("ClusterFailoverMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterFailoverMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterFragmentationMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterFragmentationMemoryMb = (double?) content.GetValueForProperty("ClusterFragmentationMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterFragmentationMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterHypervReserveMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterHypervReserveMemoryMb = (double?) content.GetValueForProperty("ClusterHypervReserveMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterHypervReserveMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterInfraVMMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterInfraVMMemoryMb = (double?) content.GetValueForProperty("ClusterInfraVMMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterInfraVMMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterTotalMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterTotalMemoryMb = (double?) content.GetValueForProperty("ClusterTotalMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterTotalMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterNonFailoverVMMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterNonFailoverVMMb = (double?) content.GetValueForProperty("ClusterNonFailoverVMMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterNonFailoverVMMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterMemoryUsedByVmsMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterMemoryUsedByVmsMb = (double?) content.GetValueForProperty("ClusterMemoryUsedByVmsMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterMemoryUsedByVmsMb, (__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 ClusterMemoryCapacity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ClusterFreeMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterFreeMemoryMb = (double?) content.GetValueForProperty("ClusterFreeMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterFreeMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterUsedMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterUsedMemoryMb = (double?) content.GetValueForProperty("ClusterUsedMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterUsedMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterFailoverMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterFailoverMemoryMb = (double?) content.GetValueForProperty("ClusterFailoverMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterFailoverMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterFragmentationMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterFragmentationMemoryMb = (double?) content.GetValueForProperty("ClusterFragmentationMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterFragmentationMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterHypervReserveMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterHypervReserveMemoryMb = (double?) content.GetValueForProperty("ClusterHypervReserveMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterHypervReserveMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterInfraVMMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterInfraVMMemoryMb = (double?) content.GetValueForProperty("ClusterInfraVMMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterInfraVMMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterTotalMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterTotalMemoryMb = (double?) content.GetValueForProperty("ClusterTotalMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterTotalMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterNonFailoverVMMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterNonFailoverVMMb = (double?) content.GetValueForProperty("ClusterNonFailoverVMMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterNonFailoverVMMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterMemoryUsedByVmsMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterMemoryUsedByVmsMb = (double?) content.GetValueForProperty("ClusterMemoryUsedByVmsMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal)this).ClusterMemoryUsedByVmsMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + 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.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClusterMemoryCapacity(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.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClusterMemoryCapacity(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.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// NodeCapacityInfo defines the required information to determine the placement of a VM. + [System.ComponentModel.TypeConverter(typeof(ClusterMemoryCapacityTypeConverter))] + public partial interface IClusterMemoryCapacity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterMemoryCapacity.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterMemoryCapacity.TypeConverter.cs new file mode 100644 index 000000000000..c9e3fe139773 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterMemoryCapacity.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ClusterMemoryCapacityTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ClusterMemoryCapacity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ClusterMemoryCapacity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ClusterMemoryCapacity.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/databoxedge/generated/api/Models/Api20220301/ClusterMemoryCapacity.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterMemoryCapacity.cs new file mode 100644 index 000000000000..7e9873f4246d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterMemoryCapacity.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// NodeCapacityInfo defines the required information to determine the placement of a VM. + /// + public partial class ClusterMemoryCapacity : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacityInternal + { + + /// Backing field for property. + private double? _clusterFailoverMemoryMb; + + /// The failover memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public double? ClusterFailoverMemoryMb { get => this._clusterFailoverMemoryMb; set => this._clusterFailoverMemoryMb = value; } + + /// Backing field for property. + private double? _clusterFragmentationMemoryMb; + + /// The fragmentation memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public double? ClusterFragmentationMemoryMb { get => this._clusterFragmentationMemoryMb; set => this._clusterFragmentationMemoryMb = value; } + + /// Backing field for property. + private double? _clusterFreeMemoryMb; + + /// The free memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public double? ClusterFreeMemoryMb { get => this._clusterFreeMemoryMb; set => this._clusterFreeMemoryMb = value; } + + /// Backing field for property. + private double? _clusterHypervReserveMemoryMb; + + /// The memory reserved for Hyper-V in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public double? ClusterHypervReserveMemoryMb { get => this._clusterHypervReserveMemoryMb; set => this._clusterHypervReserveMemoryMb = value; } + + /// Backing field for property. + private double? _clusterInfraVMMemoryMb; + + /// The memory of the Infra VM in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public double? ClusterInfraVMMemoryMb { get => this._clusterInfraVMMemoryMb; set => this._clusterInfraVMMemoryMb = value; } + + /// Backing field for property. + private double? _clusterMemoryUsedByVmsMb; + + /// The memory used by VMs in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public double? ClusterMemoryUsedByVmsMb { get => this._clusterMemoryUsedByVmsMb; set => this._clusterMemoryUsedByVmsMb = value; } + + /// Backing field for property. + private double? _clusterNonFailoverVMMb; + + /// The non-failover memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public double? ClusterNonFailoverVMMb { get => this._clusterNonFailoverVMMb; set => this._clusterNonFailoverVMMb = value; } + + /// Backing field for property. + private double? _clusterTotalMemoryMb; + + /// The total memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public double? ClusterTotalMemoryMb { get => this._clusterTotalMemoryMb; set => this._clusterTotalMemoryMb = value; } + + /// Backing field for property. + private double? _clusterUsedMemoryMb; + + /// The used memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public double? ClusterUsedMemoryMb { get => this._clusterUsedMemoryMb; set => this._clusterUsedMemoryMb = value; } + + /// Creates an new instance. + public ClusterMemoryCapacity() + { + + } + } + /// NodeCapacityInfo defines the required information to determine the placement of a VM. + public partial interface IClusterMemoryCapacity : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The failover memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The failover memory in the cluster in MB.", + SerializedName = @"clusterFailoverMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? ClusterFailoverMemoryMb { get; set; } + /// The fragmentation memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The fragmentation memory in the cluster in MB.", + SerializedName = @"clusterFragmentationMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? ClusterFragmentationMemoryMb { get; set; } + /// The free memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The free memory in the cluster in MB.", + SerializedName = @"clusterFreeMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? ClusterFreeMemoryMb { get; set; } + /// The memory reserved for Hyper-V in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The memory reserved for Hyper-V in the cluster in MB.", + SerializedName = @"clusterHypervReserveMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? ClusterHypervReserveMemoryMb { get; set; } + /// The memory of the Infra VM in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The memory of the Infra VM in the cluster in MB.", + SerializedName = @"clusterInfraVmMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? ClusterInfraVMMemoryMb { get; set; } + /// The memory used by VMs in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The memory used by VMs in the cluster in MB.", + SerializedName = @"clusterMemoryUsedByVmsMb", + PossibleTypes = new [] { typeof(double) })] + double? ClusterMemoryUsedByVmsMb { get; set; } + /// The non-failover memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The non-failover memory in the cluster in MB.", + SerializedName = @"clusterNonFailoverVmMb", + PossibleTypes = new [] { typeof(double) })] + double? ClusterNonFailoverVMMb { get; set; } + /// The total memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total memory in the cluster in MB.", + SerializedName = @"clusterTotalMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? ClusterTotalMemoryMb { get; set; } + /// The used memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The used memory in the cluster in MB.", + SerializedName = @"clusterUsedMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? ClusterUsedMemoryMb { get; set; } + + } + /// NodeCapacityInfo defines the required information to determine the placement of a VM. + internal partial interface IClusterMemoryCapacityInternal + + { + /// The failover memory in the cluster in MB. + double? ClusterFailoverMemoryMb { get; set; } + /// The fragmentation memory in the cluster in MB. + double? ClusterFragmentationMemoryMb { get; set; } + /// The free memory in the cluster in MB. + double? ClusterFreeMemoryMb { get; set; } + /// The memory reserved for Hyper-V in the cluster in MB. + double? ClusterHypervReserveMemoryMb { get; set; } + /// The memory of the Infra VM in the cluster in MB. + double? ClusterInfraVMMemoryMb { get; set; } + /// The memory used by VMs in the cluster in MB. + double? ClusterMemoryUsedByVmsMb { get; set; } + /// The non-failover memory in the cluster in MB. + double? ClusterNonFailoverVMMb { get; set; } + /// The total memory in the cluster in MB. + double? ClusterTotalMemoryMb { get; set; } + /// The used memory in the cluster in MB. + double? ClusterUsedMemoryMb { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterMemoryCapacity.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterMemoryCapacity.json.cs new file mode 100644 index 000000000000..8d82d1963e07 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterMemoryCapacity.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// NodeCapacityInfo defines the required information to determine the placement of a VM. + /// + public partial class ClusterMemoryCapacity + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ClusterMemoryCapacity(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_clusterFreeMemoryMb = If( json?.PropertyT("clusterFreeMemoryMb"), out var __jsonClusterFreeMemoryMb) ? (double?)__jsonClusterFreeMemoryMb : ClusterFreeMemoryMb;} + {_clusterUsedMemoryMb = If( json?.PropertyT("clusterUsedMemoryMb"), out var __jsonClusterUsedMemoryMb) ? (double?)__jsonClusterUsedMemoryMb : ClusterUsedMemoryMb;} + {_clusterFailoverMemoryMb = If( json?.PropertyT("clusterFailoverMemoryMb"), out var __jsonClusterFailoverMemoryMb) ? (double?)__jsonClusterFailoverMemoryMb : ClusterFailoverMemoryMb;} + {_clusterFragmentationMemoryMb = If( json?.PropertyT("clusterFragmentationMemoryMb"), out var __jsonClusterFragmentationMemoryMb) ? (double?)__jsonClusterFragmentationMemoryMb : ClusterFragmentationMemoryMb;} + {_clusterHypervReserveMemoryMb = If( json?.PropertyT("clusterHypervReserveMemoryMb"), out var __jsonClusterHypervReserveMemoryMb) ? (double?)__jsonClusterHypervReserveMemoryMb : ClusterHypervReserveMemoryMb;} + {_clusterInfraVMMemoryMb = If( json?.PropertyT("clusterInfraVmMemoryMb"), out var __jsonClusterInfraVMMemoryMb) ? (double?)__jsonClusterInfraVMMemoryMb : ClusterInfraVMMemoryMb;} + {_clusterTotalMemoryMb = If( json?.PropertyT("clusterTotalMemoryMb"), out var __jsonClusterTotalMemoryMb) ? (double?)__jsonClusterTotalMemoryMb : ClusterTotalMemoryMb;} + {_clusterNonFailoverVMMb = If( json?.PropertyT("clusterNonFailoverVmMb"), out var __jsonClusterNonFailoverVMMb) ? (double?)__jsonClusterNonFailoverVMMb : ClusterNonFailoverVMMb;} + {_clusterMemoryUsedByVmsMb = If( json?.PropertyT("clusterMemoryUsedByVmsMb"), out var __jsonClusterMemoryUsedByVmsMb) ? (double?)__jsonClusterMemoryUsedByVmsMb : ClusterMemoryUsedByVmsMb;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ClusterMemoryCapacity(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._clusterFreeMemoryMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((double)this._clusterFreeMemoryMb) : null, "clusterFreeMemoryMb" ,container.Add ); + AddIf( null != this._clusterUsedMemoryMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((double)this._clusterUsedMemoryMb) : null, "clusterUsedMemoryMb" ,container.Add ); + AddIf( null != this._clusterFailoverMemoryMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((double)this._clusterFailoverMemoryMb) : null, "clusterFailoverMemoryMb" ,container.Add ); + AddIf( null != this._clusterFragmentationMemoryMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((double)this._clusterFragmentationMemoryMb) : null, "clusterFragmentationMemoryMb" ,container.Add ); + AddIf( null != this._clusterHypervReserveMemoryMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((double)this._clusterHypervReserveMemoryMb) : null, "clusterHypervReserveMemoryMb" ,container.Add ); + AddIf( null != this._clusterInfraVMMemoryMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((double)this._clusterInfraVMMemoryMb) : null, "clusterInfraVmMemoryMb" ,container.Add ); + AddIf( null != this._clusterTotalMemoryMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((double)this._clusterTotalMemoryMb) : null, "clusterTotalMemoryMb" ,container.Add ); + AddIf( null != this._clusterNonFailoverVMMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((double)this._clusterNonFailoverVMMb) : null, "clusterNonFailoverVmMb" ,container.Add ); + AddIf( null != this._clusterMemoryUsedByVmsMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((double)this._clusterMemoryUsedByVmsMb) : null, "clusterMemoryUsedByVmsMb" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterStorageViewData.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterStorageViewData.PowerShell.cs new file mode 100644 index 000000000000..27d236aad8c2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterStorageViewData.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Cluster Storage Data. + [System.ComponentModel.TypeConverter(typeof(ClusterStorageViewDataTypeConverter))] + public partial class ClusterStorageViewData + { + + /// + /// 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 ClusterStorageViewData(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ClusterTotalStorageMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewDataInternal)this).ClusterTotalStorageMb = (double?) content.GetValueForProperty("ClusterTotalStorageMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewDataInternal)this).ClusterTotalStorageMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterFreeStorageMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewDataInternal)this).ClusterFreeStorageMb = (double?) content.GetValueForProperty("ClusterFreeStorageMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewDataInternal)this).ClusterFreeStorageMb, (__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 ClusterStorageViewData(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ClusterTotalStorageMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewDataInternal)this).ClusterTotalStorageMb = (double?) content.GetValueForProperty("ClusterTotalStorageMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewDataInternal)this).ClusterTotalStorageMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterFreeStorageMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewDataInternal)this).ClusterFreeStorageMb = (double?) content.GetValueForProperty("ClusterFreeStorageMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewDataInternal)this).ClusterFreeStorageMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + 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.DataBoxEdge.Models.Api20220301.IClusterStorageViewData DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClusterStorageViewData(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.DataBoxEdge.Models.Api20220301.IClusterStorageViewData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClusterStorageViewData(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.DataBoxEdge.Models.Api20220301.IClusterStorageViewData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Cluster Storage Data. + [System.ComponentModel.TypeConverter(typeof(ClusterStorageViewDataTypeConverter))] + public partial interface IClusterStorageViewData + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterStorageViewData.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterStorageViewData.TypeConverter.cs new file mode 100644 index 000000000000..bd00cfcfa938 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterStorageViewData.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ClusterStorageViewDataTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IClusterStorageViewData ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewData).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ClusterStorageViewData.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ClusterStorageViewData.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ClusterStorageViewData.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/databoxedge/generated/api/Models/Api20220301/ClusterStorageViewData.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterStorageViewData.cs new file mode 100644 index 000000000000..f724ef5fe1a5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterStorageViewData.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Cluster Storage Data. + public partial class ClusterStorageViewData : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewData, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewDataInternal + { + + /// Backing field for property. + private double? _clusterFreeStorageMb; + + /// The available or free storage on the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public double? ClusterFreeStorageMb { get => this._clusterFreeStorageMb; set => this._clusterFreeStorageMb = value; } + + /// Backing field for property. + private double? _clusterTotalStorageMb; + + /// Total storage on the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public double? ClusterTotalStorageMb { get => this._clusterTotalStorageMb; set => this._clusterTotalStorageMb = value; } + + /// Creates an new instance. + public ClusterStorageViewData() + { + + } + } + /// Cluster Storage Data. + public partial interface IClusterStorageViewData : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The available or free storage on the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The available or free storage on the cluster in MB.", + SerializedName = @"clusterFreeStorageMb", + PossibleTypes = new [] { typeof(double) })] + double? ClusterFreeStorageMb { get; set; } + /// Total storage on the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total storage on the cluster in MB.", + SerializedName = @"clusterTotalStorageMb", + PossibleTypes = new [] { typeof(double) })] + double? ClusterTotalStorageMb { get; set; } + + } + /// Cluster Storage Data. + internal partial interface IClusterStorageViewDataInternal + + { + /// The available or free storage on the cluster in MB. + double? ClusterFreeStorageMb { get; set; } + /// Total storage on the cluster in MB. + double? ClusterTotalStorageMb { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterStorageViewData.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterStorageViewData.json.cs new file mode 100644 index 000000000000..afdc8ebc2077 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ClusterStorageViewData.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Cluster Storage Data. + public partial class ClusterStorageViewData + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ClusterStorageViewData(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_clusterTotalStorageMb = If( json?.PropertyT("clusterTotalStorageMb"), out var __jsonClusterTotalStorageMb) ? (double?)__jsonClusterTotalStorageMb : ClusterTotalStorageMb;} + {_clusterFreeStorageMb = If( json?.PropertyT("clusterFreeStorageMb"), out var __jsonClusterFreeStorageMb) ? (double?)__jsonClusterFreeStorageMb : ClusterFreeStorageMb;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewData. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewData. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewData FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ClusterStorageViewData(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._clusterTotalStorageMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((double)this._clusterTotalStorageMb) : null, "clusterTotalStorageMb" ,container.Add ); + AddIf( null != this._clusterFreeStorageMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((double)this._clusterFreeStorageMb) : null, "clusterFreeStorageMb" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/CniConfig.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CniConfig.PowerShell.cs new file mode 100644 index 000000000000..1828140a636a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CniConfig.PowerShell.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Cni configuration + [System.ComponentModel.TypeConverter(typeof(CniConfigTypeConverter))] + public partial class CniConfig + { + + /// + /// 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 CniConfig(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.DataBoxEdge.Models.Api20220301.ICniConfigInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("PodSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)this).PodSubnet = (string) content.GetValueForProperty("PodSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)this).PodSubnet, global::System.Convert.ToString); + } + if (content.Contains("ServiceSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)this).ServiceSubnet = (string) content.GetValueForProperty("ServiceSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)this).ServiceSubnet, 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 CniConfig(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.DataBoxEdge.Models.Api20220301.ICniConfigInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("PodSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)this).PodSubnet = (string) content.GetValueForProperty("PodSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)this).PodSubnet, global::System.Convert.ToString); + } + if (content.Contains("ServiceSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)this).ServiceSubnet = (string) content.GetValueForProperty("ServiceSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)this).ServiceSubnet, 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.DataBoxEdge.Models.Api20220301.ICniConfig DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CniConfig(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.DataBoxEdge.Models.Api20220301.ICniConfig DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CniConfig(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.DataBoxEdge.Models.Api20220301.ICniConfig FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Cni configuration + [System.ComponentModel.TypeConverter(typeof(CniConfigTypeConverter))] + public partial interface ICniConfig + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/CniConfig.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CniConfig.TypeConverter.cs new file mode 100644 index 000000000000..c9a48f9a3fb2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CniConfig.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CniConfigTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ICniConfig ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CniConfig.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CniConfig.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CniConfig.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/databoxedge/generated/api/Models/Api20220301/CniConfig.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CniConfig.cs new file mode 100644 index 000000000000..5d84d6b3f6ab --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CniConfig.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Cni configuration + public partial class CniConfig : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal + { + + /// Internal Acessors for PodSubnet + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal.PodSubnet { get => this._podSubnet; set { {_podSubnet = value;} } } + + /// Internal Acessors for ServiceSubnet + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal.ServiceSubnet { get => this._serviceSubnet; set { {_serviceSubnet = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal.Type { get => this._type; set { {_type = value;} } } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal.Version { get => this._version; set { {_version = value;} } } + + /// Backing field for property. + private string _podSubnet; + + /// Pod Subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string PodSubnet { get => this._podSubnet; } + + /// Backing field for property. + private string _serviceSubnet; + + /// Service subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ServiceSubnet { get => this._serviceSubnet; } + + /// Backing field for property. + private string _type; + + /// Cni type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Backing field for property. + private string _version; + + /// Cni version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Version { get => this._version; } + + /// Creates an new instance. + public CniConfig() + { + + } + } + /// Cni configuration + public partial interface ICniConfig : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Pod Subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Pod Subnet", + SerializedName = @"podSubnet", + PossibleTypes = new [] { typeof(string) })] + string PodSubnet { get; } + /// Service subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Service subnet", + SerializedName = @"serviceSubnet", + PossibleTypes = new [] { typeof(string) })] + string ServiceSubnet { get; } + /// Cni type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Cni type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + /// Cni version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Cni version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; } + + } + /// Cni configuration + internal partial interface ICniConfigInternal + + { + /// Pod Subnet + string PodSubnet { get; set; } + /// Service subnet + string ServiceSubnet { get; set; } + /// Cni type + string Type { get; set; } + /// Cni version + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/CniConfig.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/CniConfig.json.cs new file mode 100644 index 000000000000..cc1492da7728 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/CniConfig.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Cni configuration + public partial class CniConfig + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal CniConfig(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + {_podSubnet = If( json?.PropertyT("podSubnet"), out var __jsonPodSubnet) ? (string)__jsonPodSubnet : (string)PodSubnet;} + {_serviceSubnet = If( json?.PropertyT("serviceSubnet"), out var __jsonServiceSubnet) ? (string)__jsonServiceSubnet : (string)ServiceSubnet;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new CniConfig(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._podSubnet)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._podSubnet.ToString()) : null, "podSubnet" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._serviceSubnet)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._serviceSubnet.ToString()) : null, "serviceSubnet" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ComputeResource.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ComputeResource.PowerShell.cs new file mode 100644 index 000000000000..42e2f9f44611 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ComputeResource.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Compute infrastructure Resource + [System.ComponentModel.TypeConverter(typeof(ComputeResourceTypeConverter))] + public partial class ComputeResource + { + + /// + /// 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 ComputeResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProcessorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResourceInternal)this).ProcessorCount = (int) content.GetValueForProperty("ProcessorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResourceInternal)this).ProcessorCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MemoryInGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResourceInternal)this).MemoryInGb = (long) content.GetValueForProperty("MemoryInGb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResourceInternal)this).MemoryInGb, (__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 ComputeResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProcessorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResourceInternal)this).ProcessorCount = (int) content.GetValueForProperty("ProcessorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResourceInternal)this).ProcessorCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MemoryInGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResourceInternal)this).MemoryInGb = (long) content.GetValueForProperty("MemoryInGb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResourceInternal)this).MemoryInGb, (__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.DataBoxEdge.Models.Api20220301.IComputeResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ComputeResource(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.DataBoxEdge.Models.Api20220301.IComputeResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ComputeResource(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.DataBoxEdge.Models.Api20220301.IComputeResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Compute infrastructure Resource + [System.ComponentModel.TypeConverter(typeof(ComputeResourceTypeConverter))] + public partial interface IComputeResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ComputeResource.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ComputeResource.TypeConverter.cs new file mode 100644 index 000000000000..f0fd398b5836 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ComputeResource.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ComputeResourceTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IComputeResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ComputeResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ComputeResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ComputeResource.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/databoxedge/generated/api/Models/Api20220301/ComputeResource.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ComputeResource.cs new file mode 100644 index 000000000000..976ea05f8b46 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ComputeResource.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Compute infrastructure Resource + public partial class ComputeResource : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResource, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResourceInternal + { + + /// Backing field for property. + private long _memoryInGb; + + /// Memory in GB + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public long MemoryInGb { get => this._memoryInGb; set => this._memoryInGb = value; } + + /// Backing field for property. + private int _processorCount; + + /// Processor count + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int ProcessorCount { get => this._processorCount; set => this._processorCount = value; } + + /// Creates an new instance. + public ComputeResource() + { + + } + } + /// Compute infrastructure Resource + public partial interface IComputeResource : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Memory in GB + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Memory in GB", + SerializedName = @"memoryInGB", + PossibleTypes = new [] { typeof(long) })] + long MemoryInGb { get; set; } + /// Processor count + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Processor count", + SerializedName = @"processorCount", + PossibleTypes = new [] { typeof(int) })] + int ProcessorCount { get; set; } + + } + /// Compute infrastructure Resource + internal partial interface IComputeResourceInternal + + { + /// Memory in GB + long MemoryInGb { get; set; } + /// Processor count + int ProcessorCount { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ComputeResource.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ComputeResource.json.cs new file mode 100644 index 000000000000..a59686538c44 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ComputeResource.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Compute infrastructure Resource + public partial class ComputeResource + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ComputeResource(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_processorCount = If( json?.PropertyT("processorCount"), out var __jsonProcessorCount) ? (int)__jsonProcessorCount : ProcessorCount;} + {_memoryInGb = If( json?.PropertyT("memoryInGB"), out var __jsonMemoryInGb) ? (long)__jsonMemoryInGb : MemoryInGb;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ComputeResource(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber(this._processorCount), "processorCount" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber(this._memoryInGb), "memoryInGB" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ContactDetails.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContactDetails.PowerShell.cs new file mode 100644 index 000000000000..aeffab903ba4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContactDetails.PowerShell.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Contains all the contact details of the customer. + [System.ComponentModel.TypeConverter(typeof(ContactDetailsTypeConverter))] + public partial class ContactDetails + { + + /// + /// 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 ContactDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ContactPerson")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)this).ContactPerson = (string) content.GetValueForProperty("ContactPerson",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)this).ContactPerson, global::System.Convert.ToString); + } + if (content.Contains("CompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)this).CompanyName = (string) content.GetValueForProperty("CompanyName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)this).CompanyName, global::System.Convert.ToString); + } + if (content.Contains("Phone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)this).Phone, global::System.Convert.ToString); + } + if (content.Contains("EmailList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)this).EmailList = (string[]) content.GetValueForProperty("EmailList",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)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 ContactDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ContactPerson")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)this).ContactPerson = (string) content.GetValueForProperty("ContactPerson",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)this).ContactPerson, global::System.Convert.ToString); + } + if (content.Contains("CompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)this).CompanyName = (string) content.GetValueForProperty("CompanyName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)this).CompanyName, global::System.Convert.ToString); + } + if (content.Contains("Phone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)this).Phone, global::System.Convert.ToString); + } + if (content.Contains("EmailList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)this).EmailList = (string[]) content.GetValueForProperty("EmailList",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)this).EmailList, __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.DataBoxEdge.Models.Api20220301.IContactDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ContactDetails(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.DataBoxEdge.Models.Api20220301.IContactDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ContactDetails(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.DataBoxEdge.Models.Api20220301.IContactDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Contains all the contact details of the customer. + [System.ComponentModel.TypeConverter(typeof(ContactDetailsTypeConverter))] + public partial interface IContactDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ContactDetails.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContactDetails.TypeConverter.cs new file mode 100644 index 000000000000..93b2c2dc0227 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContactDetails.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ContactDetailsTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IContactDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ContactDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ContactDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ContactDetails.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/databoxedge/generated/api/Models/Api20220301/ContactDetails.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContactDetails.cs new file mode 100644 index 000000000000..84c0d1b23e92 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContactDetails.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Contains all the contact details of the customer. + public partial class ContactDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetails, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal + { + + /// Backing field for property. + private string _companyName; + + /// The name of the company. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string CompanyName { get => this._companyName; set => this._companyName = value; } + + /// Backing field for property. + private string _contactPerson; + + /// The contact person name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ContactPerson { get => this._contactPerson; set => this._contactPerson = value; } + + /// Backing field for property. + private string[] _emailList; + + /// The email list. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string[] EmailList { get => this._emailList; set => this._emailList = value; } + + /// Backing field for property. + private string _phone; + + /// The phone number. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Phone { get => this._phone; set => this._phone = value; } + + /// Creates an new instance. + public ContactDetails() + { + + } + } + /// Contains all the contact details of the customer. + public partial interface IContactDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The name of the company. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the company.", + SerializedName = @"companyName", + PossibleTypes = new [] { typeof(string) })] + string CompanyName { get; set; } + /// The contact person name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The contact person name.", + SerializedName = @"contactPerson", + PossibleTypes = new [] { typeof(string) })] + string ContactPerson { get; set; } + /// The email list. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The email list.", + SerializedName = @"emailList", + PossibleTypes = new [] { typeof(string) })] + string[] EmailList { get; set; } + /// The phone number. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The phone number.", + SerializedName = @"phone", + PossibleTypes = new [] { typeof(string) })] + string Phone { get; set; } + + } + /// Contains all the contact details of the customer. + internal partial interface IContactDetailsInternal + + { + /// The name of the company. + string CompanyName { get; set; } + /// The contact person name. + string ContactPerson { get; set; } + /// The email list. + string[] EmailList { get; set; } + /// The phone number. + string Phone { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ContactDetails.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContactDetails.json.cs new file mode 100644 index 000000000000..ee1e27ecb4f0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContactDetails.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Contains all the contact details of the customer. + public partial class ContactDetails + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ContactDetails(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_contactPerson = If( json?.PropertyT("contactPerson"), out var __jsonContactPerson) ? (string)__jsonContactPerson : (string)ContactPerson;} + {_companyName = If( json?.PropertyT("companyName"), out var __jsonCompanyName) ? (string)__jsonCompanyName : (string)CompanyName;} + {_phone = If( json?.PropertyT("phone"), out var __jsonPhone) ? (string)__jsonPhone : (string)Phone;} + {_emailList = If( json?.PropertyT("emailList"), out var __jsonEmailList) ? If( __jsonEmailList as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : EmailList;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ContactDetails(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._contactPerson)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._contactPerson.ToString()) : null, "contactPerson" ,container.Add ); + AddIf( null != (((object)this._companyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._companyName.ToString()) : null, "companyName" ,container.Add ); + AddIf( null != (((object)this._phone)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._phone.ToString()) : null, "phone" ,container.Add ); + if (null != this._emailList) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._emailList ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/Container.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Container.PowerShell.cs new file mode 100644 index 000000000000..9938004ba795 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Container.PowerShell.cs @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Represents a container on the Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(ContainerTypeConverter))] + public partial class Container + { + + /// + /// 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 Container(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.DataBoxEdge.Models.Api20220301.IContainerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContainerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("RefreshDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails) content.GetValueForProperty("RefreshDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RefreshDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus.CreateFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).DataFormat = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat) content.GetValueForProperty("DataFormat",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).DataFormat, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat.CreateFrom); + } + if (content.Contains("CreatedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).CreatedDateTime = (global::System.DateTime?) content.GetValueForProperty("CreatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).CreatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RefreshDetailLastJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetailLastJob = (string) content.GetValueForProperty("RefreshDetailLastJob",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetailLastJob, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RefreshDetailInProgressRefreshJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetailInProgressRefreshJobId = (string) content.GetValueForProperty("RefreshDetailInProgressRefreshJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetailInProgressRefreshJobId, global::System.Convert.ToString); + } + if (content.Contains("RefreshDetailLastCompletedRefreshJobTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetailLastCompletedRefreshJobTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RefreshDetailLastCompletedRefreshJobTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetailLastCompletedRefreshJobTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RefreshDetailErrorManifestFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetailErrorManifestFile = (string) content.GetValueForProperty("RefreshDetailErrorManifestFile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetailErrorManifestFile, 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 Container(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.DataBoxEdge.Models.Api20220301.IContainerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContainerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("RefreshDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails) content.GetValueForProperty("RefreshDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RefreshDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus.CreateFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DataFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).DataFormat = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat) content.GetValueForProperty("DataFormat",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).DataFormat, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat.CreateFrom); + } + if (content.Contains("CreatedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).CreatedDateTime = (global::System.DateTime?) content.GetValueForProperty("CreatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).CreatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RefreshDetailLastJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetailLastJob = (string) content.GetValueForProperty("RefreshDetailLastJob",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetailLastJob, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RefreshDetailInProgressRefreshJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetailInProgressRefreshJobId = (string) content.GetValueForProperty("RefreshDetailInProgressRefreshJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetailInProgressRefreshJobId, global::System.Convert.ToString); + } + if (content.Contains("RefreshDetailLastCompletedRefreshJobTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetailLastCompletedRefreshJobTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RefreshDetailLastCompletedRefreshJobTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetailLastCompletedRefreshJobTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RefreshDetailErrorManifestFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetailErrorManifestFile = (string) content.GetValueForProperty("RefreshDetailErrorManifestFile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal)this).RefreshDetailErrorManifestFile, 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.DataBoxEdge.Models.Api20220301.IContainer DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Container(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.DataBoxEdge.Models.Api20220301.IContainer DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Container(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.DataBoxEdge.Models.Api20220301.IContainer FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Represents a container on the Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(ContainerTypeConverter))] + public partial interface IContainer + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Container.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Container.TypeConverter.cs new file mode 100644 index 000000000000..1ba5bbba2464 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Container.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ContainerTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IContainer ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Container.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Container.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Container.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/databoxedge/generated/api/Models/Api20220301/Container.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Container.cs new file mode 100644 index 000000000000..05980ce8e0f8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Container.cs @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Represents a container on the Data Box Edge/Gateway device. + public partial class Container : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// The UTC time when container got created. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? CreatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)Property).CreatedDateTime; } + + /// DataFormat for Container + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat DataFormat { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)Property).DataFormat; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)Property).DataFormat = value ; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for CreatedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal.CreatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)Property).CreatedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)Property).CreatedDateTime = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContainerProperties()); set { {_property = value;} } } + + /// Internal Acessors for RefreshDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal.RefreshDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)Property).RefreshDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)Property).RefreshDetail = value; } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)Property).ContainerStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)Property).ContainerStatus = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerProperties _property; + + /// The container properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContainerProperties()); set => this._property = value; } + + /// + /// Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This + /// could be a failed job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string RefreshDetailErrorManifestFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)Property).RefreshDetailErrorManifestFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)Property).RefreshDetailErrorManifestFile = value ?? null; } + + /// + /// If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that + /// job. The field is empty if no job is in progress. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string RefreshDetailInProgressRefreshJobId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)Property).RefreshDetailInProgressRefreshJobId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)Property).RefreshDetailInProgressRefreshJobId = value ?? null; } + + /// + /// Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed + /// job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? RefreshDetailLastCompletedRefreshJobTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)Property).RefreshDetailLastCompletedRefreshJobTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)Property).RefreshDetailLastCompletedRefreshJobTimeInUtc = value ?? default(global::System.DateTime); } + + /// + /// Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a + /// successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string RefreshDetailLastJob { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)Property).RefreshDetailLastJob; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)Property).RefreshDetailLastJob = value ?? null; } + + /// Current status of the container. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)Property).ContainerStatus; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of Container + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Creates an new instance. + public Container() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// Represents a container on the Data Box Edge/Gateway device. + public partial interface IContainer : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// The UTC time when container got created. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The UTC time when container got created.", + SerializedName = @"createdDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedDateTime { get; } + /// DataFormat for Container + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"DataFormat for Container", + SerializedName = @"dataFormat", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat DataFormat { get; set; } + /// + /// Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This + /// could be a failed job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This could be a failed job or a successful job.", + SerializedName = @"errorManifestFile", + PossibleTypes = new [] { typeof(string) })] + string RefreshDetailErrorManifestFile { get; set; } + /// + /// If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that + /// job. The field is empty if no job is in progress. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that job. The field is empty if no job is in progress.", + SerializedName = @"inProgressRefreshJobId", + PossibleTypes = new [] { typeof(string) })] + string RefreshDetailInProgressRefreshJobId { get; set; } + /// + /// Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed + /// job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed job or a successful job.", + SerializedName = @"lastCompletedRefreshJobTimeInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RefreshDetailLastCompletedRefreshJobTimeInUtc { get; set; } + /// + /// Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a + /// successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a successful job.", + SerializedName = @"lastJob", + PossibleTypes = new [] { typeof(string) })] + string RefreshDetailLastJob { get; set; } + /// Current status of the container. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current status of the container.", + SerializedName = @"containerStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus? Status { get; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// Represents a container on the Data Box Edge/Gateway device. + internal partial interface IContainerInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// The UTC time when container got created. + global::System.DateTime? CreatedDateTime { get; set; } + /// DataFormat for Container + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat DataFormat { get; set; } + /// The container properties. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerProperties Property { get; set; } + /// Details of the refresh job on this container. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails RefreshDetail { get; set; } + /// + /// Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This + /// could be a failed job or a successful job. + /// + string RefreshDetailErrorManifestFile { get; set; } + /// + /// If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that + /// job. The field is empty if no job is in progress. + /// + string RefreshDetailInProgressRefreshJobId { get; set; } + /// + /// Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed + /// job or a successful job. + /// + global::System.DateTime? RefreshDetailLastCompletedRefreshJobTimeInUtc { get; set; } + /// + /// Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a + /// successful job. + /// + string RefreshDetailLastJob { get; set; } + /// Current status of the container. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus? Status { get; set; } + /// Metadata pertaining to creation and last modification of Container + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Container.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Container.json.cs new file mode 100644 index 000000000000..ddb2c532a793 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Container.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Represents a container on the Data Box Edge/Gateway device. + public partial class Container + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal Container(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContainerProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new Container(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerList.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerList.PowerShell.cs new file mode 100644 index 000000000000..8701b2b6b2b5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Collection of all the containers on the Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(ContainerListTypeConverter))] + public partial class ContainerList + { + + /// + /// 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 ContainerList(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.DataBoxEdge.Models.Api20220301.IContainerListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContainerTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerListInternal)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 ContainerList(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.DataBoxEdge.Models.Api20220301.IContainerListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContainerTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerListInternal)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.DataBoxEdge.Models.Api20220301.IContainerList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ContainerList(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.DataBoxEdge.Models.Api20220301.IContainerList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ContainerList(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.DataBoxEdge.Models.Api20220301.IContainerList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of all the containers on the Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(ContainerListTypeConverter))] + public partial interface IContainerList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerList.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerList.TypeConverter.cs new file mode 100644 index 000000000000..8593e652e6fa --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ContainerListTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IContainerList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ContainerList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ContainerList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ContainerList.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/databoxedge/generated/api/Models/Api20220301/ContainerList.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerList.cs new file mode 100644 index 000000000000..c25d9af1cb7a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerList.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Collection of all the containers on the Data Box Edge/Gateway device. + public partial class ContainerList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerList, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerListInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer[] _value; + + /// The list of containers. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer[] Value { get => this._value; } + + /// Creates an new instance. + public ContainerList() + { + + } + } + /// Collection of all the containers on the Data Box Edge/Gateway device. + public partial interface IContainerList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Link to the next set of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of containers. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of containers.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer[] Value { get; } + + } + /// Collection of all the containers on the Data Box Edge/Gateway device. + internal partial interface IContainerListInternal + + { + /// Link to the next set of results. + string NextLink { get; set; } + /// The list of containers. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerList.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerList.json.cs new file mode 100644 index 000000000000..a083709ba7bd --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerList.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Collection of all the containers on the Data Box Edge/Gateway device. + public partial class ContainerList + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ContainerList(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IContainer) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Container.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.DataBoxEdge.Models.Api20220301.IContainerList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ContainerList(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/ContainerProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerProperties.PowerShell.cs new file mode 100644 index 000000000000..3f1cdf3ea987 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerProperties.PowerShell.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The container properties. + [System.ComponentModel.TypeConverter(typeof(ContainerPropertiesTypeConverter))] + public partial class ContainerProperties + { + + /// + /// 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 ContainerProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RefreshDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails) content.GetValueForProperty("RefreshDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RefreshDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("ContainerStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).ContainerStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus?) content.GetValueForProperty("ContainerStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).ContainerStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus.CreateFrom); + } + if (content.Contains("DataFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).DataFormat = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat) content.GetValueForProperty("DataFormat",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).DataFormat, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat.CreateFrom); + } + if (content.Contains("CreatedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).CreatedDateTime = (global::System.DateTime?) content.GetValueForProperty("CreatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).CreatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RefreshDetailLastJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetailLastJob = (string) content.GetValueForProperty("RefreshDetailLastJob",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetailLastJob, global::System.Convert.ToString); + } + if (content.Contains("RefreshDetailInProgressRefreshJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetailInProgressRefreshJobId = (string) content.GetValueForProperty("RefreshDetailInProgressRefreshJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetailInProgressRefreshJobId, global::System.Convert.ToString); + } + if (content.Contains("RefreshDetailLastCompletedRefreshJobTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetailLastCompletedRefreshJobTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RefreshDetailLastCompletedRefreshJobTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetailLastCompletedRefreshJobTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RefreshDetailErrorManifestFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetailErrorManifestFile = (string) content.GetValueForProperty("RefreshDetailErrorManifestFile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetailErrorManifestFile, 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 ContainerProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RefreshDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails) content.GetValueForProperty("RefreshDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RefreshDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("ContainerStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).ContainerStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus?) content.GetValueForProperty("ContainerStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).ContainerStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus.CreateFrom); + } + if (content.Contains("DataFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).DataFormat = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat) content.GetValueForProperty("DataFormat",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).DataFormat, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat.CreateFrom); + } + if (content.Contains("CreatedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).CreatedDateTime = (global::System.DateTime?) content.GetValueForProperty("CreatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).CreatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RefreshDetailLastJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetailLastJob = (string) content.GetValueForProperty("RefreshDetailLastJob",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetailLastJob, global::System.Convert.ToString); + } + if (content.Contains("RefreshDetailInProgressRefreshJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetailInProgressRefreshJobId = (string) content.GetValueForProperty("RefreshDetailInProgressRefreshJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetailInProgressRefreshJobId, global::System.Convert.ToString); + } + if (content.Contains("RefreshDetailLastCompletedRefreshJobTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetailLastCompletedRefreshJobTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RefreshDetailLastCompletedRefreshJobTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetailLastCompletedRefreshJobTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RefreshDetailErrorManifestFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetailErrorManifestFile = (string) content.GetValueForProperty("RefreshDetailErrorManifestFile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal)this).RefreshDetailErrorManifestFile, 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.DataBoxEdge.Models.Api20220301.IContainerProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ContainerProperties(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.DataBoxEdge.Models.Api20220301.IContainerProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ContainerProperties(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.DataBoxEdge.Models.Api20220301.IContainerProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The container properties. + [System.ComponentModel.TypeConverter(typeof(ContainerPropertiesTypeConverter))] + public partial interface IContainerProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerProperties.TypeConverter.cs new file mode 100644 index 000000000000..a17cdec48791 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ContainerPropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IContainerProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ContainerProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ContainerProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ContainerProperties.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/databoxedge/generated/api/Models/Api20220301/ContainerProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerProperties.cs new file mode 100644 index 000000000000..71c28a9b6a37 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerProperties.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The container properties. + public partial class ContainerProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus? _containerStatus; + + /// Current status of the container. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus? ContainerStatus { get => this._containerStatus; } + + /// Backing field for property. + private global::System.DateTime? _createdDateTime; + + /// The UTC time when container got created. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? CreatedDateTime { get => this._createdDateTime; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat _dataFormat; + + /// DataFormat for Container + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat DataFormat { get => this._dataFormat; set => this._dataFormat = value; } + + /// Internal Acessors for ContainerStatus + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal.ContainerStatus { get => this._containerStatus; set { {_containerStatus = value;} } } + + /// Internal Acessors for CreatedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal.CreatedDateTime { get => this._createdDateTime; set { {_createdDateTime = value;} } } + + /// Internal Acessors for RefreshDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerPropertiesInternal.RefreshDetail { get => (this._refreshDetail = this._refreshDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RefreshDetails()); set { {_refreshDetail = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails _refreshDetail; + + /// Details of the refresh job on this container. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails RefreshDetail { get => (this._refreshDetail = this._refreshDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RefreshDetails()); } + + /// + /// Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This + /// could be a failed job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string RefreshDetailErrorManifestFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)RefreshDetail).ErrorManifestFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)RefreshDetail).ErrorManifestFile = value ?? null; } + + /// + /// If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that + /// job. The field is empty if no job is in progress. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string RefreshDetailInProgressRefreshJobId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)RefreshDetail).InProgressRefreshJobId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)RefreshDetail).InProgressRefreshJobId = value ?? null; } + + /// + /// Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed + /// job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? RefreshDetailLastCompletedRefreshJobTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)RefreshDetail).LastCompletedRefreshJobTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)RefreshDetail).LastCompletedRefreshJobTimeInUtc = value ?? default(global::System.DateTime); } + + /// + /// Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a + /// successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string RefreshDetailLastJob { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)RefreshDetail).LastJob; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)RefreshDetail).LastJob = value ?? null; } + + /// Creates an new instance. + public ContainerProperties() + { + + } + } + /// The container properties. + public partial interface IContainerProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Current status of the container. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current status of the container.", + SerializedName = @"containerStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus? ContainerStatus { get; } + /// The UTC time when container got created. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The UTC time when container got created.", + SerializedName = @"createdDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedDateTime { get; } + /// DataFormat for Container + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"DataFormat for Container", + SerializedName = @"dataFormat", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat DataFormat { get; set; } + /// + /// Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This + /// could be a failed job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This could be a failed job or a successful job.", + SerializedName = @"errorManifestFile", + PossibleTypes = new [] { typeof(string) })] + string RefreshDetailErrorManifestFile { get; set; } + /// + /// If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that + /// job. The field is empty if no job is in progress. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that job. The field is empty if no job is in progress.", + SerializedName = @"inProgressRefreshJobId", + PossibleTypes = new [] { typeof(string) })] + string RefreshDetailInProgressRefreshJobId { get; set; } + /// + /// Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed + /// job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed job or a successful job.", + SerializedName = @"lastCompletedRefreshJobTimeInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RefreshDetailLastCompletedRefreshJobTimeInUtc { get; set; } + /// + /// Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a + /// successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a successful job.", + SerializedName = @"lastJob", + PossibleTypes = new [] { typeof(string) })] + string RefreshDetailLastJob { get; set; } + + } + /// The container properties. + internal partial interface IContainerPropertiesInternal + + { + /// Current status of the container. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus? ContainerStatus { get; set; } + /// The UTC time when container got created. + global::System.DateTime? CreatedDateTime { get; set; } + /// DataFormat for Container + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat DataFormat { get; set; } + /// Details of the refresh job on this container. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails RefreshDetail { get; set; } + /// + /// Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This + /// could be a failed job or a successful job. + /// + string RefreshDetailErrorManifestFile { get; set; } + /// + /// If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that + /// job. The field is empty if no job is in progress. + /// + string RefreshDetailInProgressRefreshJobId { get; set; } + /// + /// Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed + /// job or a successful job. + /// + global::System.DateTime? RefreshDetailLastCompletedRefreshJobTimeInUtc { get; set; } + /// + /// Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a + /// successful job. + /// + string RefreshDetailLastJob { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerProperties.json.cs new file mode 100644 index 000000000000..7b88a57e98f3 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ContainerProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The container properties. + public partial class ContainerProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ContainerProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_refreshDetail = If( json?.PropertyT("refreshDetails"), out var __jsonRefreshDetails) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RefreshDetails.FromJson(__jsonRefreshDetails) : RefreshDetail;} + {_containerStatus = If( json?.PropertyT("containerStatus"), out var __jsonContainerStatus) ? (string)__jsonContainerStatus : (string)ContainerStatus;} + {_dataFormat = If( json?.PropertyT("dataFormat"), out var __jsonDataFormat) ? (string)__jsonDataFormat : (string)DataFormat;} + {_createdDateTime = If( json?.PropertyT("createdDateTime"), out var __jsonCreatedDateTime) ? global::System.DateTime.TryParse((string)__jsonCreatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateTimeValue) ? __jsonCreatedDateTimeValue : CreatedDateTime : CreatedDateTime;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainerProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ContainerProperties(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._refreshDetail ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._refreshDetail.ToJson(null,serializationMode) : null, "refreshDetails" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._containerStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._containerStatus.ToString()) : null, "containerStatus" ,container.Add ); + } + AddIf( null != (((object)this._dataFormat)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._dataFormat.ToString()) : null, "dataFormat" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._createdDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._createdDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdDateTime" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevice.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevice.PowerShell.cs new file mode 100644 index 000000000000..0f02199435d0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevice.PowerShell.cs @@ -0,0 +1,622 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDeviceTypeConverter))] + public partial class DataBoxEdgeDevice + { + + /// + /// 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 DataBoxEdgeDevice(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevicePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceKind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceKind.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName?) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier.CreateFrom); + } + if (content.Contains("CreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).CreatedBy, global::System.Convert.ToString); + } + if (content.Contains("CreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PropertiesSystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("PropertiesSystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("EdgeProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).EdgeProfile = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile) content.GetValueForProperty("EdgeProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).EdgeProfile, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileTypeConverter.ConvertFrom); + } + if (content.Contains("DataResidency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DataResidency = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidency) content.GetValueForProperty("DataResidency",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DataResidency, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataResidencyTypeConverter.ConvertFrom); + } + if (content.Contains("DeviceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType?) content.GetValueForProperty("DeviceType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType.CreateFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("CreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("LastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).LastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("LastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ResourceMoveDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ResourceMoveDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetails) content.GetValueForProperty("ResourceMoveDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ResourceMoveDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceMoveDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus.CreateFrom); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ModelDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ModelDescription = (string) content.GetValueForProperty("ModelDescription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ModelDescription, global::System.Convert.ToString); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("Culture")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Culture = (string) content.GetValueForProperty("Culture",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Culture, global::System.Convert.ToString); + } + if (content.Contains("DeviceModel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceModel = (string) content.GetValueForProperty("DeviceModel",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceModel, global::System.Convert.ToString); + } + if (content.Contains("DeviceSoftwareVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceSoftwareVersion = (string) content.GetValueForProperty("DeviceSoftwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceSoftwareVersion, global::System.Convert.ToString); + } + if (content.Contains("DeviceLocalCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceLocalCapacity = (long?) content.GetValueForProperty("DeviceLocalCapacity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceLocalCapacity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TimeZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).TimeZone, global::System.Convert.ToString); + } + if (content.Contains("DeviceHcsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceHcsVersion = (string) content.GetValueForProperty("DeviceHcsVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceHcsVersion, global::System.Convert.ToString); + } + if (content.Contains("ConfiguredRoleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ConfiguredRoleType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes[]) content.GetValueForProperty("ConfiguredRoleType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ConfiguredRoleType, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes.CreateFrom)); + } + if (content.Contains("NodeCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).NodeCount = (int?) content.GetValueForProperty("NodeCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).NodeCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PropertiesSystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataCreatedBy = (string) content.GetValueForProperty("PropertiesSystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("PropertiesSystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("PropertiesSystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EdgeProfileSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).EdgeProfileSubscription = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription) content.GetValueForProperty("EdgeProfileSubscription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).EdgeProfileSubscription, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionTypeConverter.ConvertFrom); + } + if (content.Contains("DataResidencyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DataResidencyType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType?) content.GetValueForProperty("DataResidencyType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DataResidencyType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType.CreateFrom); + } + if (content.Contains("PropertiesSystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("PropertiesSystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("PropertiesSystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataLastModifiedBy = (string) content.GetValueForProperty("PropertiesSystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("PropertiesSystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("PropertiesSystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("PropertiesSystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("PropertiesSystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ResourceMoveDetailOperationInProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ResourceMoveDetailOperationInProgress = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus?) content.GetValueForProperty("ResourceMoveDetailOperationInProgress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ResourceMoveDetailOperationInProgress, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus.CreateFrom); + } + if (content.Contains("ResourceMoveDetailOperationInProgressLockTimeoutInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ResourceMoveDetailOperationInProgressLockTimeoutInUtc = (global::System.DateTime?) content.GetValueForProperty("ResourceMoveDetailOperationInProgressLockTimeoutInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ResourceMoveDetailOperationInProgressLockTimeoutInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SubscriptionProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionProperty = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties) content.GetValueForProperty("SubscriptionProperty",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionProperty, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState?) content.GetValueForProperty("SubscriptionState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState.CreateFrom); + } + if (content.Contains("SubscriptionRegistrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionRegistrationId = (string) content.GetValueForProperty("SubscriptionRegistrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionRegistrationId, global::System.Convert.ToString); + } + if (content.Contains("PropertiesEdgeProfileSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesEdgeProfileSubscriptionId = (string) content.GetValueForProperty("PropertiesEdgeProfileSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesEdgeProfileSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionRegistrationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionRegistrationDate = (string) content.GetValueForProperty("SubscriptionRegistrationDate",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionRegistrationDate, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("QuotaId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).QuotaId = (string) content.GetValueForProperty("QuotaId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).QuotaId, global::System.Convert.ToString); + } + if (content.Contains("SerializedDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SerializedDetail = (string) content.GetValueForProperty("SerializedDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SerializedDetail, global::System.Convert.ToString); + } + if (content.Contains("RegisteredFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).RegisteredFeature = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[]) content.GetValueForProperty("RegisteredFeature",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).RegisteredFeature, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionRegisteredFeaturesTypeConverter.ConvertFrom)); + } + if (content.Contains("LocationPlacementId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).LocationPlacementId = (string) content.GetValueForProperty("LocationPlacementId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).LocationPlacementId, 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 DataBoxEdgeDevice(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevicePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceKind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceKind.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName?) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier.CreateFrom); + } + if (content.Contains("CreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).CreatedBy, global::System.Convert.ToString); + } + if (content.Contains("CreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PropertiesSystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("PropertiesSystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("EdgeProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).EdgeProfile = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile) content.GetValueForProperty("EdgeProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).EdgeProfile, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileTypeConverter.ConvertFrom); + } + if (content.Contains("DataResidency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DataResidency = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidency) content.GetValueForProperty("DataResidency",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DataResidency, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataResidencyTypeConverter.ConvertFrom); + } + if (content.Contains("DeviceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType?) content.GetValueForProperty("DeviceType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType.CreateFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("CreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("LastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).LastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("LastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ResourceMoveDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ResourceMoveDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetails) content.GetValueForProperty("ResourceMoveDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ResourceMoveDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceMoveDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus.CreateFrom); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ModelDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ModelDescription = (string) content.GetValueForProperty("ModelDescription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ModelDescription, global::System.Convert.ToString); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("Culture")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Culture = (string) content.GetValueForProperty("Culture",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).Culture, global::System.Convert.ToString); + } + if (content.Contains("DeviceModel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceModel = (string) content.GetValueForProperty("DeviceModel",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceModel, global::System.Convert.ToString); + } + if (content.Contains("DeviceSoftwareVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceSoftwareVersion = (string) content.GetValueForProperty("DeviceSoftwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceSoftwareVersion, global::System.Convert.ToString); + } + if (content.Contains("DeviceLocalCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceLocalCapacity = (long?) content.GetValueForProperty("DeviceLocalCapacity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceLocalCapacity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TimeZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).TimeZone, global::System.Convert.ToString); + } + if (content.Contains("DeviceHcsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceHcsVersion = (string) content.GetValueForProperty("DeviceHcsVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DeviceHcsVersion, global::System.Convert.ToString); + } + if (content.Contains("ConfiguredRoleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ConfiguredRoleType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes[]) content.GetValueForProperty("ConfiguredRoleType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ConfiguredRoleType, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes.CreateFrom)); + } + if (content.Contains("NodeCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).NodeCount = (int?) content.GetValueForProperty("NodeCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).NodeCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PropertiesSystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataCreatedBy = (string) content.GetValueForProperty("PropertiesSystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("PropertiesSystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("PropertiesSystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EdgeProfileSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).EdgeProfileSubscription = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription) content.GetValueForProperty("EdgeProfileSubscription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).EdgeProfileSubscription, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionTypeConverter.ConvertFrom); + } + if (content.Contains("DataResidencyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DataResidencyType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType?) content.GetValueForProperty("DataResidencyType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).DataResidencyType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType.CreateFrom); + } + if (content.Contains("PropertiesSystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("PropertiesSystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("PropertiesSystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataLastModifiedBy = (string) content.GetValueForProperty("PropertiesSystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("PropertiesSystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("PropertiesSystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("PropertiesSystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("PropertiesSystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesSystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ResourceMoveDetailOperationInProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ResourceMoveDetailOperationInProgress = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus?) content.GetValueForProperty("ResourceMoveDetailOperationInProgress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ResourceMoveDetailOperationInProgress, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus.CreateFrom); + } + if (content.Contains("ResourceMoveDetailOperationInProgressLockTimeoutInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ResourceMoveDetailOperationInProgressLockTimeoutInUtc = (global::System.DateTime?) content.GetValueForProperty("ResourceMoveDetailOperationInProgressLockTimeoutInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).ResourceMoveDetailOperationInProgressLockTimeoutInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SubscriptionProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionProperty = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties) content.GetValueForProperty("SubscriptionProperty",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionProperty, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState?) content.GetValueForProperty("SubscriptionState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState.CreateFrom); + } + if (content.Contains("SubscriptionRegistrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionRegistrationId = (string) content.GetValueForProperty("SubscriptionRegistrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionRegistrationId, global::System.Convert.ToString); + } + if (content.Contains("PropertiesEdgeProfileSubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesEdgeProfileSubscriptionId = (string) content.GetValueForProperty("PropertiesEdgeProfileSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).PropertiesEdgeProfileSubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionRegistrationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionRegistrationDate = (string) content.GetValueForProperty("SubscriptionRegistrationDate",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionRegistrationDate, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("QuotaId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).QuotaId = (string) content.GetValueForProperty("QuotaId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).QuotaId, global::System.Convert.ToString); + } + if (content.Contains("SerializedDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SerializedDetail = (string) content.GetValueForProperty("SerializedDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).SerializedDetail, global::System.Convert.ToString); + } + if (content.Contains("RegisteredFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).RegisteredFeature = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[]) content.GetValueForProperty("RegisteredFeature",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).RegisteredFeature, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionRegisteredFeaturesTypeConverter.ConvertFrom)); + } + if (content.Contains("LocationPlacementId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).LocationPlacementId = (string) content.GetValueForProperty("LocationPlacementId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal)this).LocationPlacementId, 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataBoxEdgeDevice(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataBoxEdgeDevice(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDeviceTypeConverter))] + public partial interface IDataBoxEdgeDevice + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevice.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevice.TypeConverter.cs new file mode 100644 index 000000000000..5c0883979ef7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevice.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataBoxEdgeDeviceTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataBoxEdgeDevice.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataBoxEdgeDevice.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataBoxEdgeDevice.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/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevice.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevice.cs new file mode 100644 index 000000000000..08e63f8a7916 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevice.cs @@ -0,0 +1,897 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The Data Box Edge/Gateway device. + public partial class DataBoxEdgeDevice : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// Type of compute roles configured. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes[] ConfiguredRoleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).ConfiguredRoleType; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? CreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? CreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The Data Box Edge/Gateway device culture. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Culture { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).Culture; } + + /// DataResidencyType enum + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType? DataResidencyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DataResidencyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DataResidencyType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType)""); } + + /// The Description of the Data Box Edge/Gateway device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).Description; } + + /// The device software version number of the device (eg: 1.2.18105.6). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string DeviceHcsVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DeviceHcsVersion; } + + /// The Data Box Edge/Gateway device local capacity in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public long? DeviceLocalCapacity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DeviceLocalCapacity; } + + /// The Data Box Edge/Gateway device model. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string DeviceModel { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DeviceModel; } + + /// The Data Box Edge/Gateway device software version. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string DeviceSoftwareVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DeviceSoftwareVersion; } + + /// The type of the Data Box Edge/Gateway device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType? DeviceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DeviceType; } + + /// Backing field for property. + private string _etag; + + /// The etag for the devices. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Etag { get => this._etag; set => this._etag = value; } + + /// The Data Box Edge/Gateway device name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).FriendlyName; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentity _identity; + + /// Msi identity of the resource + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceIdentity()); set => this._identity = value; } + + /// Service Principal Id backing the Msi + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)Identity).PrincipalId; } + + /// Home Tenant Id + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)Identity).TenantId; } + + /// Identity type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceKind? _kind; + + /// The kind of the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceKind? Kind { get => this._kind; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? LastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string LastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// Backing field for property. + private string _location; + + /// + /// The location of the device. This is a supported and registered Azure geographical region (for example, West US, East US, + /// or Southeast Asia). The geographical region of a device cannot be changed once it is created, but if an identical geographical + /// region is specified on update, the request will succeed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string LocationPlacementId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).LocationPlacementId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).LocationPlacementId = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for ConfiguredRoleType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.ConfiguredRoleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).ConfiguredRoleType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).ConfiguredRoleType = value; } + + /// Internal Acessors for Culture + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.Culture { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).Culture; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).Culture = value; } + + /// Internal Acessors for DataResidency + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidency Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.DataResidency { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DataResidency; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DataResidency = value; } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).Description = value; } + + /// Internal Acessors for DeviceHcsVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.DeviceHcsVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DeviceHcsVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DeviceHcsVersion = value; } + + /// Internal Acessors for DeviceLocalCapacity + long? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.DeviceLocalCapacity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DeviceLocalCapacity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DeviceLocalCapacity = value; } + + /// Internal Acessors for DeviceModel + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.DeviceModel { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DeviceModel; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DeviceModel = value; } + + /// Internal Acessors for DeviceSoftwareVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.DeviceSoftwareVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DeviceSoftwareVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DeviceSoftwareVersion = value; } + + /// Internal Acessors for DeviceType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.DeviceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DeviceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DeviceType = value; } + + /// Internal Acessors for EdgeProfile + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.EdgeProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).EdgeProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).EdgeProfile = value; } + + /// Internal Acessors for EdgeProfileSubscription + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.EdgeProfileSubscription { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).EdgeProfileSubscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).EdgeProfileSubscription = value; } + + /// Internal Acessors for FriendlyName + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).FriendlyName = value; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentity Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceIdentity()); set { {_identity = value;} } } + + /// Internal Acessors for IdentityPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)Identity).PrincipalId = value; } + + /// Internal Acessors for IdentityTenantId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)Identity).TenantId = value; } + + /// Internal Acessors for Kind + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceKind? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.Kind { get => this._kind; set { {_kind = value;} } } + + /// Internal Acessors for ModelDescription + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.ModelDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).ModelDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).ModelDescription = value; } + + /// Internal Acessors for NodeCount + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.NodeCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).NodeCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).NodeCount = value; } + + /// Internal Acessors for PropertiesSystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.PropertiesSystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SystemData = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceProperties()); set { {_property = value;} } } + + /// Internal Acessors for ResourceMoveDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetails Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.ResourceMoveDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).ResourceMoveDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).ResourceMoveDetail = value; } + + /// Internal Acessors for SerialNumber + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.SerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SerialNumber = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISku Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Sku()); set { {_sku = value;} } } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DataBoxEdgeDeviceStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DataBoxEdgeDeviceStatus = value; } + + /// Internal Acessors for SubscriptionProperty + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.SubscriptionProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SubscriptionProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SubscriptionProperty = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for TimeZone + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceInternal.TimeZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).TimeZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).TimeZone = value; } + + /// The description of the Data Box Edge/Gateway device model. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ModelDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).ModelDescription; } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// The number of nodes in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? NodeCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).NodeCount; } + + /// ARM ID of the subscription + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string PropertiesEdgeProfileSubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).Id = value ?? null; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? PropertiesSystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string PropertiesSystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? PropertiesSystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? PropertiesSystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string PropertiesSystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? PropertiesSystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceProperties _property; + + /// The properties of the Data Box Edge/Gateway device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceProperties()); set => this._property = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string QuotaId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).QuotaId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).QuotaId = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).RegisteredFeature; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).RegisteredFeature = value ?? null /* arrayOf */; } + + /// Denotes whether move operation is in progress + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus? ResourceMoveDetailOperationInProgress { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).ResourceMoveDetailOperationInProgress; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).ResourceMoveDetailOperationInProgress = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus)""); } + + /// Denotes the timeout of the operation to finish + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? ResourceMoveDetailOperationInProgressLockTimeoutInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).ResourceMoveDetailOperationInProgressLockTimeoutInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).ResourceMoveDetailOperationInProgressLockTimeoutInUtc = value ?? default(global::System.DateTime); } + + /// The Serial Number of Data Box Edge/Gateway device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SerialNumber; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SerializedDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SerializedDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SerializedDetail = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISku _sku; + + /// The SKU type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Sku()); set => this._sku = value; } + + /// SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuInternal)Sku).Name = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName)""); } + + /// The SKU tier. This is based on the SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier? SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuInternal)Sku).Tier; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuInternal)Sku).Tier = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier)""); } + + /// The status of the Data Box Edge/Gateway device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).DataBoxEdgeDeviceStatus; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SubscriptionId = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SubscriptionRegistrationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SubscriptionRegistrationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SubscriptionRegistrationDate = value ?? null; } + + /// Edge Subscription Registration ID + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SubscriptionRegistrationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SubscriptionRegistrationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SubscriptionRegistrationId = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState? SubscriptionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SubscriptionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).SubscriptionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// DataBoxEdge Resource + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags _tag; + + /// + /// The list of tags that describe the device. These tags can be used to view and group this device (across resource groups). + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceTags()); set => this._tag = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).TenantId = value ?? null; } + + /// The Data Box Edge/Gateway device timezone. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string TimeZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)Property).TimeZone; } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Creates an new instance. + public DataBoxEdgeDevice() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// The Data Box Edge/Gateway device. + public partial interface IDataBoxEdgeDevice : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// Type of compute roles configured. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of compute roles configured.", + SerializedName = @"configuredRoleTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes[] ConfiguredRoleType { get; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string CreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? CreatedByType { get; set; } + /// The Data Box Edge/Gateway device culture. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Data Box Edge/Gateway device culture.", + SerializedName = @"culture", + PossibleTypes = new [] { typeof(string) })] + string Culture { get; } + /// DataResidencyType enum + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DataResidencyType enum", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType? DataResidencyType { get; set; } + /// The Description of the Data Box Edge/Gateway device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Description of the Data Box Edge/Gateway device.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// The device software version number of the device (eg: 1.2.18105.6). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The device software version number of the device (eg: 1.2.18105.6).", + SerializedName = @"deviceHcsVersion", + PossibleTypes = new [] { typeof(string) })] + string DeviceHcsVersion { get; } + /// The Data Box Edge/Gateway device local capacity in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Data Box Edge/Gateway device local capacity in MB.", + SerializedName = @"deviceLocalCapacity", + PossibleTypes = new [] { typeof(long) })] + long? DeviceLocalCapacity { get; } + /// The Data Box Edge/Gateway device model. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Data Box Edge/Gateway device model.", + SerializedName = @"deviceModel", + PossibleTypes = new [] { typeof(string) })] + string DeviceModel { get; } + /// The Data Box Edge/Gateway device software version. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Data Box Edge/Gateway device software version.", + SerializedName = @"deviceSoftwareVersion", + PossibleTypes = new [] { typeof(string) })] + string DeviceSoftwareVersion { get; } + /// The type of the Data Box Edge/Gateway device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of the Data Box Edge/Gateway device.", + SerializedName = @"deviceType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType? DeviceType { get; } + /// The etag for the devices. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The etag for the devices.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; set; } + /// The Data Box Edge/Gateway device name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Data Box Edge/Gateway device name.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; } + /// Service Principal Id backing the Msi + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Service Principal Id backing the Msi", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string IdentityPrincipalId { get; } + /// Home Tenant Id + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Home Tenant Id", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string IdentityTenantId { get; } + /// Identity type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identity type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType? IdentityType { get; set; } + /// The kind of the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The kind of the device.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceKind) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceKind? Kind { get; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string LastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? LastModifiedByType { get; set; } + /// + /// The location of the device. This is a supported and registered Azure geographical region (for example, West US, East US, + /// or Southeast Asia). The geographical region of a device cannot be changed once it is created, but if an identical geographical + /// region is specified on update, the request will succeed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The location of the device. This is a supported and registered Azure geographical region (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed once it is created, but if an identical geographical region is specified on update, the request will succeed.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"locationPlacementId", + PossibleTypes = new [] { typeof(string) })] + string LocationPlacementId { get; set; } + /// The description of the Data Box Edge/Gateway device model. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The description of the Data Box Edge/Gateway device model.", + SerializedName = @"modelDescription", + PossibleTypes = new [] { typeof(string) })] + string ModelDescription { get; } + /// The number of nodes in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The number of nodes in the cluster.", + SerializedName = @"nodeCount", + PossibleTypes = new [] { typeof(int) })] + int? NodeCount { get; } + /// ARM ID of the subscription + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ARM ID of the subscription", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string PropertiesEdgeProfileSubscriptionId { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? PropertiesSystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string PropertiesSystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? PropertiesSystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? PropertiesSystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string PropertiesSystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? PropertiesSystemDataLastModifiedByType { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"quotaId", + PossibleTypes = new [] { typeof(string) })] + string QuotaId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"registeredFeatures", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get; set; } + /// Denotes whether move operation is in progress + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Denotes whether move operation is in progress", + SerializedName = @"operationInProgress", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus? ResourceMoveDetailOperationInProgress { get; set; } + /// Denotes the timeout of the operation to finish + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Denotes the timeout of the operation to finish", + SerializedName = @"operationInProgressLockTimeoutInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ResourceMoveDetailOperationInProgressLockTimeoutInUtc { get; set; } + /// The Serial Number of Data Box Edge/Gateway device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Serial Number of Data Box Edge/Gateway device.", + SerializedName = @"serialNumber", + PossibleTypes = new [] { typeof(string) })] + string SerialNumber { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"serializedDetails", + PossibleTypes = new [] { typeof(string) })] + string SerializedDetail { get; set; } + /// SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SKU name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName? SkuName { get; set; } + /// The SKU tier. This is based on the SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SKU tier. This is based on the SKU name.", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier? SkuTier { get; set; } + /// The status of the Data Box Edge/Gateway device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The status of the Data Box Edge/Gateway device.", + SerializedName = @"dataBoxEdgeDeviceStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus? Status { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"registrationDate", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionRegistrationDate { get; set; } + /// Edge Subscription Registration ID + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Edge Subscription Registration ID", + SerializedName = @"registrationId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionRegistrationId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState? SubscriptionState { get; set; } + /// + /// The list of tags that describe the device. These tags can be used to view and group this device (across resource groups). + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of tags that describe the device. These tags can be used to view and group this device (across resource groups).", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags Tag { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; set; } + /// The Data Box Edge/Gateway device timezone. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Data Box Edge/Gateway device timezone.", + SerializedName = @"timeZone", + PossibleTypes = new [] { typeof(string) })] + string TimeZone { get; } + + } + /// The Data Box Edge/Gateway device. + internal partial interface IDataBoxEdgeDeviceInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// Type of compute roles configured. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes[] ConfiguredRoleType { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? CreatedAt { get; set; } + /// The identity that created the resource. + string CreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? CreatedByType { get; set; } + /// The Data Box Edge/Gateway device culture. + string Culture { get; set; } + /// The details of data-residency related properties for this resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidency DataResidency { get; set; } + /// DataResidencyType enum + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType? DataResidencyType { get; set; } + /// The Description of the Data Box Edge/Gateway device. + string Description { get; set; } + /// The device software version number of the device (eg: 1.2.18105.6). + string DeviceHcsVersion { get; set; } + /// The Data Box Edge/Gateway device local capacity in MB. + long? DeviceLocalCapacity { get; set; } + /// The Data Box Edge/Gateway device model. + string DeviceModel { get; set; } + /// The Data Box Edge/Gateway device software version. + string DeviceSoftwareVersion { get; set; } + /// The type of the Data Box Edge/Gateway device. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType? DeviceType { get; set; } + /// The details of Edge Profile for this resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile EdgeProfile { get; set; } + /// Edge Profile Subscription + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription EdgeProfileSubscription { get; set; } + /// The etag for the devices. + string Etag { get; set; } + /// The Data Box Edge/Gateway device name. + string FriendlyName { get; set; } + /// Msi identity of the resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentity Identity { get; set; } + /// Service Principal Id backing the Msi + string IdentityPrincipalId { get; set; } + /// Home Tenant Id + string IdentityTenantId { get; set; } + /// Identity type + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType? IdentityType { get; set; } + /// The kind of the device. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceKind? Kind { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? LastModifiedAt { get; set; } + /// The identity that last modified the resource. + string LastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? LastModifiedByType { get; set; } + /// + /// The location of the device. This is a supported and registered Azure geographical region (for example, West US, East US, + /// or Southeast Asia). The geographical region of a device cannot be changed once it is created, but if an identical geographical + /// region is specified on update, the request will succeed. + /// + string Location { get; set; } + + string LocationPlacementId { get; set; } + /// The description of the Data Box Edge/Gateway device model. + string ModelDescription { get; set; } + /// The number of nodes in the cluster. + int? NodeCount { get; set; } + /// ARM ID of the subscription + string PropertiesEdgeProfileSubscriptionId { get; set; } + /// DataBoxEdge Device Properties + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData PropertiesSystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? PropertiesSystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string PropertiesSystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? PropertiesSystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? PropertiesSystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string PropertiesSystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? PropertiesSystemDataLastModifiedByType { get; set; } + /// The properties of the Data Box Edge/Gateway device. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceProperties Property { get; set; } + + string QuotaId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get; set; } + /// The details of the move operation on this resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetails ResourceMoveDetail { get; set; } + /// Denotes whether move operation is in progress + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus? ResourceMoveDetailOperationInProgress { get; set; } + /// Denotes the timeout of the operation to finish + global::System.DateTime? ResourceMoveDetailOperationInProgressLockTimeoutInUtc { get; set; } + /// The Serial Number of Data Box Edge/Gateway device. + string SerialNumber { get; set; } + + string SerializedDetail { get; set; } + /// The SKU type. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISku Sku { get; set; } + /// SKU name. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName? SkuName { get; set; } + /// The SKU tier. This is based on the SKU name. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier? SkuTier { get; set; } + /// The status of the Data Box Edge/Gateway device. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus? Status { get; set; } + + string SubscriptionId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties SubscriptionProperty { get; set; } + + string SubscriptionRegistrationDate { get; set; } + /// Edge Subscription Registration ID + string SubscriptionRegistrationId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState? SubscriptionState { get; set; } + /// DataBoxEdge Resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// + /// The list of tags that describe the device. These tags can be used to view and group this device (across resource groups). + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags Tag { get; set; } + + string TenantId { get; set; } + /// The Data Box Edge/Gateway device timezone. + string TimeZone { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevice.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevice.json.cs new file mode 100644 index 000000000000..a70802ca56da --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevice.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The Data Box Edge/Gateway device. + public partial class DataBoxEdgeDevice + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DataBoxEdgeDevice(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Sku.FromJson(__jsonSku) : Sku;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceIdentity.FromJson(__jsonIdentity) : Identity;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceProperties.FromJson(__jsonProperties) : Property;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceTags.FromJson(__jsonTags) : Tag;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DataBoxEdgeDevice(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfo.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..0634b7450484 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfo.PowerShell.cs @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The extended Info of the Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDeviceExtendedInfoTypeConverter))] + public partial class DataBoxEdgeDeviceExtendedInfo + { + + /// + /// 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 DataBoxEdgeDeviceExtendedInfo(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfoPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EncryptionKeyThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).EncryptionKeyThumbprint = (string) content.GetValueForProperty("EncryptionKeyThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).EncryptionKeyThumbprint, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).EncryptionKey = (string) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).EncryptionKey, global::System.Convert.ToString); + } + if (content.Contains("ResourceKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ResourceKey = (string) content.GetValueForProperty("ResourceKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ResourceKey, global::System.Convert.ToString); + } + if (content.Contains("ClientSecretStoreId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ClientSecretStoreId = (string) content.GetValueForProperty("ClientSecretStoreId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ClientSecretStoreId, global::System.Convert.ToString); + } + if (content.Contains("ClientSecretStoreUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ClientSecretStoreUrl = (string) content.GetValueForProperty("ClientSecretStoreUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ClientSecretStoreUrl, global::System.Convert.ToString); + } + if (content.Contains("ChannelIntegrityKeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ChannelIntegrityKeyName = (string) content.GetValueForProperty("ChannelIntegrityKeyName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ChannelIntegrityKeyName, global::System.Convert.ToString); + } + if (content.Contains("ChannelIntegrityKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ChannelIntegrityKeyVersion = (string) content.GetValueForProperty("ChannelIntegrityKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ChannelIntegrityKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultSyncStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).KeyVaultSyncStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus?) content.GetValueForProperty("KeyVaultSyncStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).KeyVaultSyncStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus.CreateFrom); + } + if (content.Contains("DeviceSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).DeviceSecret = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets) content.GetValueForProperty("DeviceSecret",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).DeviceSecret, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecretsTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterWitnessType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ClusterWitnessType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType?) content.GetValueForProperty("ClusterWitnessType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ClusterWitnessType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType.CreateFrom); + } + if (content.Contains("FileShareWitnessLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).FileShareWitnessLocation = (string) content.GetValueForProperty("FileShareWitnessLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).FileShareWitnessLocation, global::System.Convert.ToString); + } + if (content.Contains("FileShareWitnessUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).FileShareWitnessUsername = (string) content.GetValueForProperty("FileShareWitnessUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).FileShareWitnessUsername, global::System.Convert.ToString); + } + if (content.Contains("CloudWitnessStorageAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).CloudWitnessStorageAccountName = (string) content.GetValueForProperty("CloudWitnessStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).CloudWitnessStorageAccountName, global::System.Convert.ToString); + } + if (content.Contains("CloudWitnessContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).CloudWitnessContainerName = (string) content.GetValueForProperty("CloudWitnessContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).CloudWitnessContainerName, global::System.Convert.ToString); + } + if (content.Contains("CloudWitnessStorageEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).CloudWitnessStorageEndpoint = (string) content.GetValueForProperty("CloudWitnessStorageEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).CloudWitnessStorageEndpoint, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataLastModifiedAt, (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 DataBoxEdgeDeviceExtendedInfo(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfoPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EncryptionKeyThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).EncryptionKeyThumbprint = (string) content.GetValueForProperty("EncryptionKeyThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).EncryptionKeyThumbprint, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).EncryptionKey = (string) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).EncryptionKey, global::System.Convert.ToString); + } + if (content.Contains("ResourceKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ResourceKey = (string) content.GetValueForProperty("ResourceKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ResourceKey, global::System.Convert.ToString); + } + if (content.Contains("ClientSecretStoreId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ClientSecretStoreId = (string) content.GetValueForProperty("ClientSecretStoreId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ClientSecretStoreId, global::System.Convert.ToString); + } + if (content.Contains("ClientSecretStoreUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ClientSecretStoreUrl = (string) content.GetValueForProperty("ClientSecretStoreUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ClientSecretStoreUrl, global::System.Convert.ToString); + } + if (content.Contains("ChannelIntegrityKeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ChannelIntegrityKeyName = (string) content.GetValueForProperty("ChannelIntegrityKeyName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ChannelIntegrityKeyName, global::System.Convert.ToString); + } + if (content.Contains("ChannelIntegrityKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ChannelIntegrityKeyVersion = (string) content.GetValueForProperty("ChannelIntegrityKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ChannelIntegrityKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultSyncStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).KeyVaultSyncStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus?) content.GetValueForProperty("KeyVaultSyncStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).KeyVaultSyncStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus.CreateFrom); + } + if (content.Contains("DeviceSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).DeviceSecret = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets) content.GetValueForProperty("DeviceSecret",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).DeviceSecret, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecretsTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterWitnessType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ClusterWitnessType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType?) content.GetValueForProperty("ClusterWitnessType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).ClusterWitnessType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType.CreateFrom); + } + if (content.Contains("FileShareWitnessLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).FileShareWitnessLocation = (string) content.GetValueForProperty("FileShareWitnessLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).FileShareWitnessLocation, global::System.Convert.ToString); + } + if (content.Contains("FileShareWitnessUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).FileShareWitnessUsername = (string) content.GetValueForProperty("FileShareWitnessUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).FileShareWitnessUsername, global::System.Convert.ToString); + } + if (content.Contains("CloudWitnessStorageAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).CloudWitnessStorageAccountName = (string) content.GetValueForProperty("CloudWitnessStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).CloudWitnessStorageAccountName, global::System.Convert.ToString); + } + if (content.Contains("CloudWitnessContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).CloudWitnessContainerName = (string) content.GetValueForProperty("CloudWitnessContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).CloudWitnessContainerName, global::System.Convert.ToString); + } + if (content.Contains("CloudWitnessStorageEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).CloudWitnessStorageEndpoint = (string) content.GetValueForProperty("CloudWitnessStorageEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).CloudWitnessStorageEndpoint, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal)this).SystemDataLastModifiedAt, (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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataBoxEdgeDeviceExtendedInfo(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataBoxEdgeDeviceExtendedInfo(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The extended Info of the Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDeviceExtendedInfoTypeConverter))] + public partial interface IDataBoxEdgeDeviceExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfo.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..d5f5c70d15a0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataBoxEdgeDeviceExtendedInfoTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataBoxEdgeDeviceExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataBoxEdgeDeviceExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataBoxEdgeDeviceExtendedInfo.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/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfo.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfo.cs new file mode 100644 index 000000000000..20bd8b188bf4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfo.cs @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The extended Info of the Data Box Edge/Gateway device. + public partial class DataBoxEdgeDeviceExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// The name of Channel Integrity Key stored in the Client Key Vault + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ChannelIntegrityKeyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).ChannelIntegrityKeyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).ChannelIntegrityKeyName = value ?? null; } + + /// The version of Channel Integrity Key stored in the Client Key Vault + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ChannelIntegrityKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).ChannelIntegrityKeyVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).ChannelIntegrityKeyVersion = value ?? null; } + + /// The Key Vault ARM Id for client secrets + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ClientSecretStoreId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).ClientSecretStoreId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).ClientSecretStoreId = value ?? null; } + + /// The url to access the Client Key Vault + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ClientSecretStoreUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).ClientSecretStoreUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).ClientSecretStoreUrl = value ?? null; } + + /// The Container for cloud witness in the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CloudWitnessContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).CloudWitnessContainerName; } + + /// The Cloud Witness Storage account name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CloudWitnessStorageAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).CloudWitnessStorageAccountName; } + + /// The Azure service endpoint of the cloud witness storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CloudWitnessStorageEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).CloudWitnessStorageEndpoint; } + + /// Cluster Witness Type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType? ClusterWitnessType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).ClusterWitnessType; } + + /// Device secrets, will be returned only with ODataFilter $expand=deviceSecrets + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets DeviceSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).DeviceSecret; } + + /// + /// The public part of the encryption certificate. Client uses this to encrypt any secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string EncryptionKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).EncryptionKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).EncryptionKey = value ?? null; } + + /// The digital signature of encrypted certificate. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string EncryptionKeyThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).EncryptionKeyThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).EncryptionKeyThumbprint = value ?? null; } + + /// The witness location of file share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string FileShareWitnessLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).FileShareWitnessLocation; } + + /// The username of file share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string FileShareWitnessUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).FileShareWitnessUsername; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// Key vault sync status + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus? KeyVaultSyncStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).KeyVaultSyncStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).KeyVaultSyncStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus)""); } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for CloudWitnessContainerName + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal.CloudWitnessContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).CloudWitnessContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).CloudWitnessContainerName = value; } + + /// Internal Acessors for CloudWitnessStorageAccountName + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal.CloudWitnessStorageAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).CloudWitnessStorageAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).CloudWitnessStorageAccountName = value; } + + /// Internal Acessors for CloudWitnessStorageEndpoint + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal.CloudWitnessStorageEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).CloudWitnessStorageEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).CloudWitnessStorageEndpoint = value; } + + /// Internal Acessors for ClusterWitnessType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal.ClusterWitnessType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).ClusterWitnessType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).ClusterWitnessType = value; } + + /// Internal Acessors for DeviceSecret + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal.DeviceSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).DeviceSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).DeviceSecret = value; } + + /// Internal Acessors for FileShareWitnessLocation + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal.FileShareWitnessLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).FileShareWitnessLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).FileShareWitnessLocation = value; } + + /// Internal Acessors for FileShareWitnessUsername + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal.FileShareWitnessUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).FileShareWitnessUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).FileShareWitnessUsername = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfoProperties()); set { {_property = value;} } } + + /// Internal Acessors for ResourceKey + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal.ResourceKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).ResourceKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).ResourceKey = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoProperties _property; + + /// The extended info properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfoProperties()); set => this._property = value; } + + /// The Resource ID of the Resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ResourceKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)Property).ResourceKey; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of DataBoxEdgeDevice + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Creates an new instance. + public DataBoxEdgeDeviceExtendedInfo() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// The extended Info of the Data Box Edge/Gateway device. + public partial interface IDataBoxEdgeDeviceExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// The name of Channel Integrity Key stored in the Client Key Vault + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of Channel Integrity Key stored in the Client Key Vault", + SerializedName = @"channelIntegrityKeyName", + PossibleTypes = new [] { typeof(string) })] + string ChannelIntegrityKeyName { get; set; } + /// The version of Channel Integrity Key stored in the Client Key Vault + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The version of Channel Integrity Key stored in the Client Key Vault", + SerializedName = @"channelIntegrityKeyVersion", + PossibleTypes = new [] { typeof(string) })] + string ChannelIntegrityKeyVersion { get; set; } + /// The Key Vault ARM Id for client secrets + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Key Vault ARM Id for client secrets", + SerializedName = @"clientSecretStoreId", + PossibleTypes = new [] { typeof(string) })] + string ClientSecretStoreId { get; set; } + /// The url to access the Client Key Vault + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The url to access the Client Key Vault", + SerializedName = @"clientSecretStoreUrl", + PossibleTypes = new [] { typeof(string) })] + string ClientSecretStoreUrl { get; set; } + /// The Container for cloud witness in the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Container for cloud witness in the storage account.", + SerializedName = @"cloudWitnessContainerName", + PossibleTypes = new [] { typeof(string) })] + string CloudWitnessContainerName { get; } + /// The Cloud Witness Storage account name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Cloud Witness Storage account name.", + SerializedName = @"cloudWitnessStorageAccountName", + PossibleTypes = new [] { typeof(string) })] + string CloudWitnessStorageAccountName { get; } + /// The Azure service endpoint of the cloud witness storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Azure service endpoint of the cloud witness storage account.", + SerializedName = @"cloudWitnessStorageEndpoint", + PossibleTypes = new [] { typeof(string) })] + string CloudWitnessStorageEndpoint { get; } + /// Cluster Witness Type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Cluster Witness Type", + SerializedName = @"clusterWitnessType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType? ClusterWitnessType { get; } + /// Device secrets, will be returned only with ODataFilter $expand=deviceSecrets + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Device secrets, will be returned only with ODataFilter $expand=deviceSecrets", + SerializedName = @"deviceSecrets", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets DeviceSecret { get; } + /// + /// The public part of the encryption certificate. Client uses this to encrypt any secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The public part of the encryption certificate. Client uses this to encrypt any secret.", + SerializedName = @"encryptionKey", + PossibleTypes = new [] { typeof(string) })] + string EncryptionKey { get; set; } + /// The digital signature of encrypted certificate. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The digital signature of encrypted certificate.", + SerializedName = @"encryptionKeyThumbprint", + PossibleTypes = new [] { typeof(string) })] + string EncryptionKeyThumbprint { get; set; } + /// The witness location of file share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The witness location of file share.", + SerializedName = @"fileShareWitnessLocation", + PossibleTypes = new [] { typeof(string) })] + string FileShareWitnessLocation { get; } + /// The username of file share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The username of file share.", + SerializedName = @"fileShareWitnessUsername", + PossibleTypes = new [] { typeof(string) })] + string FileShareWitnessUsername { get; } + /// Key vault sync status + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key vault sync status", + SerializedName = @"keyVaultSyncStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus? KeyVaultSyncStatus { get; set; } + /// The Resource ID of the Resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Resource ID of the Resource.", + SerializedName = @"resourceKey", + PossibleTypes = new [] { typeof(string) })] + string ResourceKey { get; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// The extended Info of the Data Box Edge/Gateway device. + internal partial interface IDataBoxEdgeDeviceExtendedInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// The name of Channel Integrity Key stored in the Client Key Vault + string ChannelIntegrityKeyName { get; set; } + /// The version of Channel Integrity Key stored in the Client Key Vault + string ChannelIntegrityKeyVersion { get; set; } + /// The Key Vault ARM Id for client secrets + string ClientSecretStoreId { get; set; } + /// The url to access the Client Key Vault + string ClientSecretStoreUrl { get; set; } + /// The Container for cloud witness in the storage account. + string CloudWitnessContainerName { get; set; } + /// The Cloud Witness Storage account name. + string CloudWitnessStorageAccountName { get; set; } + /// The Azure service endpoint of the cloud witness storage account. + string CloudWitnessStorageEndpoint { get; set; } + /// Cluster Witness Type + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType? ClusterWitnessType { get; set; } + /// Device secrets, will be returned only with ODataFilter $expand=deviceSecrets + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets DeviceSecret { get; set; } + /// + /// The public part of the encryption certificate. Client uses this to encrypt any secret. + /// + string EncryptionKey { get; set; } + /// The digital signature of encrypted certificate. + string EncryptionKeyThumbprint { get; set; } + /// The witness location of file share. + string FileShareWitnessLocation { get; set; } + /// The username of file share. + string FileShareWitnessUsername { get; set; } + /// Key vault sync status + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus? KeyVaultSyncStatus { get; set; } + /// The extended info properties. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoProperties Property { get; set; } + /// The Resource ID of the Resource. + string ResourceKey { get; set; } + /// Metadata pertaining to creation and last modification of DataBoxEdgeDevice + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfo.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfo.json.cs new file mode 100644 index 000000000000..efe367db8c2e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfo.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The extended Info of the Data Box Edge/Gateway device. + public partial class DataBoxEdgeDeviceExtendedInfo + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DataBoxEdgeDeviceExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfoProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DataBoxEdgeDeviceExtendedInfo(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPatch.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPatch.PowerShell.cs new file mode 100644 index 000000000000..05758e187d20 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPatch.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The Data Box Edge/Gateway device extended info patch. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDeviceExtendedInfoPatchTypeConverter))] + public partial class DataBoxEdgeDeviceExtendedInfoPatch + { + + /// + /// 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 DataBoxEdgeDeviceExtendedInfoPatch(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ClientSecretStoreId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).ClientSecretStoreId = (string) content.GetValueForProperty("ClientSecretStoreId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).ClientSecretStoreId, global::System.Convert.ToString); + } + if (content.Contains("ClientSecretStoreUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).ClientSecretStoreUrl = (string) content.GetValueForProperty("ClientSecretStoreUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).ClientSecretStoreUrl, global::System.Convert.ToString); + } + if (content.Contains("ChannelIntegrityKeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).ChannelIntegrityKeyName = (string) content.GetValueForProperty("ChannelIntegrityKeyName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).ChannelIntegrityKeyName, global::System.Convert.ToString); + } + if (content.Contains("ChannelIntegrityKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).ChannelIntegrityKeyVersion = (string) content.GetValueForProperty("ChannelIntegrityKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).ChannelIntegrityKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("SyncStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).SyncStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus?) content.GetValueForProperty("SyncStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).SyncStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DataBoxEdgeDeviceExtendedInfoPatch(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ClientSecretStoreId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).ClientSecretStoreId = (string) content.GetValueForProperty("ClientSecretStoreId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).ClientSecretStoreId, global::System.Convert.ToString); + } + if (content.Contains("ClientSecretStoreUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).ClientSecretStoreUrl = (string) content.GetValueForProperty("ClientSecretStoreUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).ClientSecretStoreUrl, global::System.Convert.ToString); + } + if (content.Contains("ChannelIntegrityKeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).ChannelIntegrityKeyName = (string) content.GetValueForProperty("ChannelIntegrityKeyName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).ChannelIntegrityKeyName, global::System.Convert.ToString); + } + if (content.Contains("ChannelIntegrityKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).ChannelIntegrityKeyVersion = (string) content.GetValueForProperty("ChannelIntegrityKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).ChannelIntegrityKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("SyncStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).SyncStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus?) content.GetValueForProperty("SyncStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal)this).SyncStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus.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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataBoxEdgeDeviceExtendedInfoPatch(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataBoxEdgeDeviceExtendedInfoPatch(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Data Box Edge/Gateway device extended info patch. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDeviceExtendedInfoPatchTypeConverter))] + public partial interface IDataBoxEdgeDeviceExtendedInfoPatch + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPatch.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPatch.TypeConverter.cs new file mode 100644 index 000000000000..ca9f4e9add55 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPatch.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataBoxEdgeDeviceExtendedInfoPatchTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatch ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatch).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataBoxEdgeDeviceExtendedInfoPatch.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataBoxEdgeDeviceExtendedInfoPatch.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataBoxEdgeDeviceExtendedInfoPatch.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/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPatch.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPatch.cs new file mode 100644 index 000000000000..ac970d809a6c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPatch.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The Data Box Edge/Gateway device extended info patch. + public partial class DataBoxEdgeDeviceExtendedInfoPatch : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatch, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatchInternal + { + + /// Backing field for property. + private string _channelIntegrityKeyName; + + /// The name for Channel Integrity Key stored in the Client Key Vault + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ChannelIntegrityKeyName { get => this._channelIntegrityKeyName; set => this._channelIntegrityKeyName = value; } + + /// Backing field for property. + private string _channelIntegrityKeyVersion; + + /// The version of Channel Integrity Key stored in the Client Key Vault + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ChannelIntegrityKeyVersion { get => this._channelIntegrityKeyVersion; set => this._channelIntegrityKeyVersion = value; } + + /// Backing field for property. + private string _clientSecretStoreId; + + /// The Key Vault ARM Id for client secrets + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ClientSecretStoreId { get => this._clientSecretStoreId; set => this._clientSecretStoreId = value; } + + /// Backing field for property. + private string _clientSecretStoreUrl; + + /// The url to access the Client Key Vault + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ClientSecretStoreUrl { get => this._clientSecretStoreUrl; set => this._clientSecretStoreUrl = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus? _syncStatus; + + /// + /// For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status will not + /// be applicable. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus? SyncStatus { get => this._syncStatus; set => this._syncStatus = value; } + + /// Creates an new instance. + public DataBoxEdgeDeviceExtendedInfoPatch() + { + + } + } + /// The Data Box Edge/Gateway device extended info patch. + public partial interface IDataBoxEdgeDeviceExtendedInfoPatch : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The name for Channel Integrity Key stored in the Client Key Vault + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name for Channel Integrity Key stored in the Client Key Vault", + SerializedName = @"channelIntegrityKeyName", + PossibleTypes = new [] { typeof(string) })] + string ChannelIntegrityKeyName { get; set; } + /// The version of Channel Integrity Key stored in the Client Key Vault + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The version of Channel Integrity Key stored in the Client Key Vault", + SerializedName = @"channelIntegrityKeyVersion", + PossibleTypes = new [] { typeof(string) })] + string ChannelIntegrityKeyVersion { get; set; } + /// The Key Vault ARM Id for client secrets + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Key Vault ARM Id for client secrets", + SerializedName = @"clientSecretStoreId", + PossibleTypes = new [] { typeof(string) })] + string ClientSecretStoreId { get; set; } + /// The url to access the Client Key Vault + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The url to access the Client Key Vault", + SerializedName = @"clientSecretStoreUrl", + PossibleTypes = new [] { typeof(string) })] + string ClientSecretStoreUrl { get; set; } + /// + /// For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status will not + /// be applicable. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status will not be applicable.", + SerializedName = @"syncStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus? SyncStatus { get; set; } + + } + /// The Data Box Edge/Gateway device extended info patch. + internal partial interface IDataBoxEdgeDeviceExtendedInfoPatchInternal + + { + /// The name for Channel Integrity Key stored in the Client Key Vault + string ChannelIntegrityKeyName { get; set; } + /// The version of Channel Integrity Key stored in the Client Key Vault + string ChannelIntegrityKeyVersion { get; set; } + /// The Key Vault ARM Id for client secrets + string ClientSecretStoreId { get; set; } + /// The url to access the Client Key Vault + string ClientSecretStoreUrl { get; set; } + /// + /// For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status will not + /// be applicable. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus? SyncStatus { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPatch.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPatch.json.cs new file mode 100644 index 000000000000..e489abbb72f9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPatch.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The Data Box Edge/Gateway device extended info patch. + public partial class DataBoxEdgeDeviceExtendedInfoPatch + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DataBoxEdgeDeviceExtendedInfoPatch(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_clientSecretStoreId = If( json?.PropertyT("clientSecretStoreId"), out var __jsonClientSecretStoreId) ? (string)__jsonClientSecretStoreId : (string)ClientSecretStoreId;} + {_clientSecretStoreUrl = If( json?.PropertyT("clientSecretStoreUrl"), out var __jsonClientSecretStoreUrl) ? (string)__jsonClientSecretStoreUrl : (string)ClientSecretStoreUrl;} + {_channelIntegrityKeyName = If( json?.PropertyT("channelIntegrityKeyName"), out var __jsonChannelIntegrityKeyName) ? (string)__jsonChannelIntegrityKeyName : (string)ChannelIntegrityKeyName;} + {_channelIntegrityKeyVersion = If( json?.PropertyT("channelIntegrityKeyVersion"), out var __jsonChannelIntegrityKeyVersion) ? (string)__jsonChannelIntegrityKeyVersion : (string)ChannelIntegrityKeyVersion;} + {_syncStatus = If( json?.PropertyT("syncStatus"), out var __jsonSyncStatus) ? (string)__jsonSyncStatus : (string)SyncStatus;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatch. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatch. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DataBoxEdgeDeviceExtendedInfoPatch(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._clientSecretStoreId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._clientSecretStoreId.ToString()) : null, "clientSecretStoreId" ,container.Add ); + AddIf( null != (((object)this._clientSecretStoreUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._clientSecretStoreUrl.ToString()) : null, "clientSecretStoreUrl" ,container.Add ); + AddIf( null != (((object)this._channelIntegrityKeyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._channelIntegrityKeyName.ToString()) : null, "channelIntegrityKeyName" ,container.Add ); + AddIf( null != (((object)this._channelIntegrityKeyVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._channelIntegrityKeyVersion.ToString()) : null, "channelIntegrityKeyVersion" ,container.Add ); + AddIf( null != (((object)this._syncStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._syncStatus.ToString()) : null, "syncStatus" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoProperties.PowerShell.cs new file mode 100644 index 000000000000..c87c50d20d5a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoProperties.PowerShell.cs @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The properties of the Data Box Edge/Gateway device extended info. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDeviceExtendedInfoPropertiesTypeConverter))] + public partial class DataBoxEdgeDeviceExtendedInfoProperties + { + + /// + /// 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 DataBoxEdgeDeviceExtendedInfoProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EncryptionKeyThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).EncryptionKeyThumbprint = (string) content.GetValueForProperty("EncryptionKeyThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).EncryptionKeyThumbprint, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).EncryptionKey = (string) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).EncryptionKey, global::System.Convert.ToString); + } + if (content.Contains("ResourceKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ResourceKey = (string) content.GetValueForProperty("ResourceKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ResourceKey, global::System.Convert.ToString); + } + if (content.Contains("ClientSecretStoreId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ClientSecretStoreId = (string) content.GetValueForProperty("ClientSecretStoreId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ClientSecretStoreId, global::System.Convert.ToString); + } + if (content.Contains("ClientSecretStoreUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ClientSecretStoreUrl = (string) content.GetValueForProperty("ClientSecretStoreUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ClientSecretStoreUrl, global::System.Convert.ToString); + } + if (content.Contains("ChannelIntegrityKeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ChannelIntegrityKeyName = (string) content.GetValueForProperty("ChannelIntegrityKeyName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ChannelIntegrityKeyName, global::System.Convert.ToString); + } + if (content.Contains("ChannelIntegrityKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ChannelIntegrityKeyVersion = (string) content.GetValueForProperty("ChannelIntegrityKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ChannelIntegrityKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultSyncStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).KeyVaultSyncStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus?) content.GetValueForProperty("KeyVaultSyncStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).KeyVaultSyncStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus.CreateFrom); + } + if (content.Contains("DeviceSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).DeviceSecret = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets) content.GetValueForProperty("DeviceSecret",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).DeviceSecret, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecretsTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterWitnessType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ClusterWitnessType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType?) content.GetValueForProperty("ClusterWitnessType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ClusterWitnessType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType.CreateFrom); + } + if (content.Contains("FileShareWitnessLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).FileShareWitnessLocation = (string) content.GetValueForProperty("FileShareWitnessLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).FileShareWitnessLocation, global::System.Convert.ToString); + } + if (content.Contains("FileShareWitnessUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).FileShareWitnessUsername = (string) content.GetValueForProperty("FileShareWitnessUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).FileShareWitnessUsername, global::System.Convert.ToString); + } + if (content.Contains("CloudWitnessStorageAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).CloudWitnessStorageAccountName = (string) content.GetValueForProperty("CloudWitnessStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).CloudWitnessStorageAccountName, global::System.Convert.ToString); + } + if (content.Contains("CloudWitnessContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).CloudWitnessContainerName = (string) content.GetValueForProperty("CloudWitnessContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).CloudWitnessContainerName, global::System.Convert.ToString); + } + if (content.Contains("CloudWitnessStorageEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).CloudWitnessStorageEndpoint = (string) content.GetValueForProperty("CloudWitnessStorageEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).CloudWitnessStorageEndpoint, 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 DataBoxEdgeDeviceExtendedInfoProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EncryptionKeyThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).EncryptionKeyThumbprint = (string) content.GetValueForProperty("EncryptionKeyThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).EncryptionKeyThumbprint, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).EncryptionKey = (string) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).EncryptionKey, global::System.Convert.ToString); + } + if (content.Contains("ResourceKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ResourceKey = (string) content.GetValueForProperty("ResourceKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ResourceKey, global::System.Convert.ToString); + } + if (content.Contains("ClientSecretStoreId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ClientSecretStoreId = (string) content.GetValueForProperty("ClientSecretStoreId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ClientSecretStoreId, global::System.Convert.ToString); + } + if (content.Contains("ClientSecretStoreUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ClientSecretStoreUrl = (string) content.GetValueForProperty("ClientSecretStoreUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ClientSecretStoreUrl, global::System.Convert.ToString); + } + if (content.Contains("ChannelIntegrityKeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ChannelIntegrityKeyName = (string) content.GetValueForProperty("ChannelIntegrityKeyName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ChannelIntegrityKeyName, global::System.Convert.ToString); + } + if (content.Contains("ChannelIntegrityKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ChannelIntegrityKeyVersion = (string) content.GetValueForProperty("ChannelIntegrityKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ChannelIntegrityKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultSyncStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).KeyVaultSyncStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus?) content.GetValueForProperty("KeyVaultSyncStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).KeyVaultSyncStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus.CreateFrom); + } + if (content.Contains("DeviceSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).DeviceSecret = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets) content.GetValueForProperty("DeviceSecret",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).DeviceSecret, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecretsTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterWitnessType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ClusterWitnessType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType?) content.GetValueForProperty("ClusterWitnessType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).ClusterWitnessType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType.CreateFrom); + } + if (content.Contains("FileShareWitnessLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).FileShareWitnessLocation = (string) content.GetValueForProperty("FileShareWitnessLocation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).FileShareWitnessLocation, global::System.Convert.ToString); + } + if (content.Contains("FileShareWitnessUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).FileShareWitnessUsername = (string) content.GetValueForProperty("FileShareWitnessUsername",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).FileShareWitnessUsername, global::System.Convert.ToString); + } + if (content.Contains("CloudWitnessStorageAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).CloudWitnessStorageAccountName = (string) content.GetValueForProperty("CloudWitnessStorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).CloudWitnessStorageAccountName, global::System.Convert.ToString); + } + if (content.Contains("CloudWitnessContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).CloudWitnessContainerName = (string) content.GetValueForProperty("CloudWitnessContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).CloudWitnessContainerName, global::System.Convert.ToString); + } + if (content.Contains("CloudWitnessStorageEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).CloudWitnessStorageEndpoint = (string) content.GetValueForProperty("CloudWitnessStorageEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal)this).CloudWitnessStorageEndpoint, 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataBoxEdgeDeviceExtendedInfoProperties(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataBoxEdgeDeviceExtendedInfoProperties(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the Data Box Edge/Gateway device extended info. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDeviceExtendedInfoPropertiesTypeConverter))] + public partial interface IDataBoxEdgeDeviceExtendedInfoProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoProperties.TypeConverter.cs new file mode 100644 index 000000000000..2cb4eb630d89 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoProperties.TypeConverter.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataBoxEdgeDeviceExtendedInfoPropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataBoxEdgeDeviceExtendedInfoProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataBoxEdgeDeviceExtendedInfoProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataBoxEdgeDeviceExtendedInfoProperties.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/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoProperties.cs new file mode 100644 index 000000000000..d2bbed2a88e1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoProperties.cs @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The properties of the Data Box Edge/Gateway device extended info. + public partial class DataBoxEdgeDeviceExtendedInfoProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal + { + + /// Backing field for property. + private string _channelIntegrityKeyName; + + /// The name of Channel Integrity Key stored in the Client Key Vault + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ChannelIntegrityKeyName { get => this._channelIntegrityKeyName; set => this._channelIntegrityKeyName = value; } + + /// Backing field for property. + private string _channelIntegrityKeyVersion; + + /// The version of Channel Integrity Key stored in the Client Key Vault + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ChannelIntegrityKeyVersion { get => this._channelIntegrityKeyVersion; set => this._channelIntegrityKeyVersion = value; } + + /// Backing field for property. + private string _clientSecretStoreId; + + /// The Key Vault ARM Id for client secrets + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ClientSecretStoreId { get => this._clientSecretStoreId; set => this._clientSecretStoreId = value; } + + /// Backing field for property. + private string _clientSecretStoreUrl; + + /// The url to access the Client Key Vault + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ClientSecretStoreUrl { get => this._clientSecretStoreUrl; set => this._clientSecretStoreUrl = value; } + + /// Backing field for property. + private string _cloudWitnessContainerName; + + /// The Container for cloud witness in the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string CloudWitnessContainerName { get => this._cloudWitnessContainerName; } + + /// Backing field for property. + private string _cloudWitnessStorageAccountName; + + /// The Cloud Witness Storage account name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string CloudWitnessStorageAccountName { get => this._cloudWitnessStorageAccountName; } + + /// Backing field for property. + private string _cloudWitnessStorageEndpoint; + + /// The Azure service endpoint of the cloud witness storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string CloudWitnessStorageEndpoint { get => this._cloudWitnessStorageEndpoint; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType? _clusterWitnessType; + + /// Cluster Witness Type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType? ClusterWitnessType { get => this._clusterWitnessType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets _deviceSecret; + + /// Device secrets, will be returned only with ODataFilter $expand=deviceSecrets + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets DeviceSecret { get => (this._deviceSecret = this._deviceSecret ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets()); } + + /// Backing field for property. + private string _encryptionKey; + + /// + /// The public part of the encryption certificate. Client uses this to encrypt any secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string EncryptionKey { get => this._encryptionKey; set => this._encryptionKey = value; } + + /// Backing field for property. + private string _encryptionKeyThumbprint; + + /// The digital signature of encrypted certificate. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string EncryptionKeyThumbprint { get => this._encryptionKeyThumbprint; set => this._encryptionKeyThumbprint = value; } + + /// Backing field for property. + private string _fileShareWitnessLocation; + + /// The witness location of file share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string FileShareWitnessLocation { get => this._fileShareWitnessLocation; } + + /// Backing field for property. + private string _fileShareWitnessUsername; + + /// The username of file share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string FileShareWitnessUsername { get => this._fileShareWitnessUsername; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus? _keyVaultSyncStatus; + + /// Key vault sync status + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus? KeyVaultSyncStatus { get => this._keyVaultSyncStatus; set => this._keyVaultSyncStatus = value; } + + /// Internal Acessors for CloudWitnessContainerName + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal.CloudWitnessContainerName { get => this._cloudWitnessContainerName; set { {_cloudWitnessContainerName = value;} } } + + /// Internal Acessors for CloudWitnessStorageAccountName + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal.CloudWitnessStorageAccountName { get => this._cloudWitnessStorageAccountName; set { {_cloudWitnessStorageAccountName = value;} } } + + /// Internal Acessors for CloudWitnessStorageEndpoint + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal.CloudWitnessStorageEndpoint { get => this._cloudWitnessStorageEndpoint; set { {_cloudWitnessStorageEndpoint = value;} } } + + /// Internal Acessors for ClusterWitnessType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal.ClusterWitnessType { get => this._clusterWitnessType; set { {_clusterWitnessType = value;} } } + + /// Internal Acessors for DeviceSecret + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal.DeviceSecret { get => (this._deviceSecret = this._deviceSecret ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets()); set { {_deviceSecret = value;} } } + + /// Internal Acessors for FileShareWitnessLocation + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal.FileShareWitnessLocation { get => this._fileShareWitnessLocation; set { {_fileShareWitnessLocation = value;} } } + + /// Internal Acessors for FileShareWitnessUsername + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal.FileShareWitnessUsername { get => this._fileShareWitnessUsername; set { {_fileShareWitnessUsername = value;} } } + + /// Internal Acessors for ResourceKey + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesInternal.ResourceKey { get => this._resourceKey; set { {_resourceKey = value;} } } + + /// Backing field for property. + private string _resourceKey; + + /// The Resource ID of the Resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ResourceKey { get => this._resourceKey; } + + /// Creates an new instance. + public DataBoxEdgeDeviceExtendedInfoProperties() + { + + } + } + /// The properties of the Data Box Edge/Gateway device extended info. + public partial interface IDataBoxEdgeDeviceExtendedInfoProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The name of Channel Integrity Key stored in the Client Key Vault + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of Channel Integrity Key stored in the Client Key Vault", + SerializedName = @"channelIntegrityKeyName", + PossibleTypes = new [] { typeof(string) })] + string ChannelIntegrityKeyName { get; set; } + /// The version of Channel Integrity Key stored in the Client Key Vault + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The version of Channel Integrity Key stored in the Client Key Vault", + SerializedName = @"channelIntegrityKeyVersion", + PossibleTypes = new [] { typeof(string) })] + string ChannelIntegrityKeyVersion { get; set; } + /// The Key Vault ARM Id for client secrets + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Key Vault ARM Id for client secrets", + SerializedName = @"clientSecretStoreId", + PossibleTypes = new [] { typeof(string) })] + string ClientSecretStoreId { get; set; } + /// The url to access the Client Key Vault + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The url to access the Client Key Vault", + SerializedName = @"clientSecretStoreUrl", + PossibleTypes = new [] { typeof(string) })] + string ClientSecretStoreUrl { get; set; } + /// The Container for cloud witness in the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Container for cloud witness in the storage account.", + SerializedName = @"cloudWitnessContainerName", + PossibleTypes = new [] { typeof(string) })] + string CloudWitnessContainerName { get; } + /// The Cloud Witness Storage account name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Cloud Witness Storage account name.", + SerializedName = @"cloudWitnessStorageAccountName", + PossibleTypes = new [] { typeof(string) })] + string CloudWitnessStorageAccountName { get; } + /// The Azure service endpoint of the cloud witness storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Azure service endpoint of the cloud witness storage account.", + SerializedName = @"cloudWitnessStorageEndpoint", + PossibleTypes = new [] { typeof(string) })] + string CloudWitnessStorageEndpoint { get; } + /// Cluster Witness Type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Cluster Witness Type", + SerializedName = @"clusterWitnessType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType? ClusterWitnessType { get; } + /// Device secrets, will be returned only with ODataFilter $expand=deviceSecrets + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Device secrets, will be returned only with ODataFilter $expand=deviceSecrets", + SerializedName = @"deviceSecrets", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets DeviceSecret { get; } + /// + /// The public part of the encryption certificate. Client uses this to encrypt any secret. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The public part of the encryption certificate. Client uses this to encrypt any secret.", + SerializedName = @"encryptionKey", + PossibleTypes = new [] { typeof(string) })] + string EncryptionKey { get; set; } + /// The digital signature of encrypted certificate. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The digital signature of encrypted certificate.", + SerializedName = @"encryptionKeyThumbprint", + PossibleTypes = new [] { typeof(string) })] + string EncryptionKeyThumbprint { get; set; } + /// The witness location of file share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The witness location of file share.", + SerializedName = @"fileShareWitnessLocation", + PossibleTypes = new [] { typeof(string) })] + string FileShareWitnessLocation { get; } + /// The username of file share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The username of file share.", + SerializedName = @"fileShareWitnessUsername", + PossibleTypes = new [] { typeof(string) })] + string FileShareWitnessUsername { get; } + /// Key vault sync status + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key vault sync status", + SerializedName = @"keyVaultSyncStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus? KeyVaultSyncStatus { get; set; } + /// The Resource ID of the Resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Resource ID of the Resource.", + SerializedName = @"resourceKey", + PossibleTypes = new [] { typeof(string) })] + string ResourceKey { get; } + + } + /// The properties of the Data Box Edge/Gateway device extended info. + internal partial interface IDataBoxEdgeDeviceExtendedInfoPropertiesInternal + + { + /// The name of Channel Integrity Key stored in the Client Key Vault + string ChannelIntegrityKeyName { get; set; } + /// The version of Channel Integrity Key stored in the Client Key Vault + string ChannelIntegrityKeyVersion { get; set; } + /// The Key Vault ARM Id for client secrets + string ClientSecretStoreId { get; set; } + /// The url to access the Client Key Vault + string ClientSecretStoreUrl { get; set; } + /// The Container for cloud witness in the storage account. + string CloudWitnessContainerName { get; set; } + /// The Cloud Witness Storage account name. + string CloudWitnessStorageAccountName { get; set; } + /// The Azure service endpoint of the cloud witness storage account. + string CloudWitnessStorageEndpoint { get; set; } + /// Cluster Witness Type + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType? ClusterWitnessType { get; set; } + /// Device secrets, will be returned only with ODataFilter $expand=deviceSecrets + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets DeviceSecret { get; set; } + /// + /// The public part of the encryption certificate. Client uses this to encrypt any secret. + /// + string EncryptionKey { get; set; } + /// The digital signature of encrypted certificate. + string EncryptionKeyThumbprint { get; set; } + /// The witness location of file share. + string FileShareWitnessLocation { get; set; } + /// The username of file share. + string FileShareWitnessUsername { get; set; } + /// Key vault sync status + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus? KeyVaultSyncStatus { get; set; } + /// The Resource ID of the Resource. + string ResourceKey { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoProperties.json.cs new file mode 100644 index 000000000000..1a202ca8e98c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoProperties.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The properties of the Data Box Edge/Gateway device extended info. + public partial class DataBoxEdgeDeviceExtendedInfoProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DataBoxEdgeDeviceExtendedInfoProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_encryptionKeyThumbprint = If( json?.PropertyT("encryptionKeyThumbprint"), out var __jsonEncryptionKeyThumbprint) ? (string)__jsonEncryptionKeyThumbprint : (string)EncryptionKeyThumbprint;} + {_encryptionKey = If( json?.PropertyT("encryptionKey"), out var __jsonEncryptionKey) ? (string)__jsonEncryptionKey : (string)EncryptionKey;} + {_resourceKey = If( json?.PropertyT("resourceKey"), out var __jsonResourceKey) ? (string)__jsonResourceKey : (string)ResourceKey;} + {_clientSecretStoreId = If( json?.PropertyT("clientSecretStoreId"), out var __jsonClientSecretStoreId) ? (string)__jsonClientSecretStoreId : (string)ClientSecretStoreId;} + {_clientSecretStoreUrl = If( json?.PropertyT("clientSecretStoreUrl"), out var __jsonClientSecretStoreUrl) ? (string)__jsonClientSecretStoreUrl : (string)ClientSecretStoreUrl;} + {_channelIntegrityKeyName = If( json?.PropertyT("channelIntegrityKeyName"), out var __jsonChannelIntegrityKeyName) ? (string)__jsonChannelIntegrityKeyName : (string)ChannelIntegrityKeyName;} + {_channelIntegrityKeyVersion = If( json?.PropertyT("channelIntegrityKeyVersion"), out var __jsonChannelIntegrityKeyVersion) ? (string)__jsonChannelIntegrityKeyVersion : (string)ChannelIntegrityKeyVersion;} + {_keyVaultSyncStatus = If( json?.PropertyT("keyVaultSyncStatus"), out var __jsonKeyVaultSyncStatus) ? (string)__jsonKeyVaultSyncStatus : (string)KeyVaultSyncStatus;} + {_deviceSecret = If( json?.PropertyT("deviceSecrets"), out var __jsonDeviceSecrets) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets.FromJson(__jsonDeviceSecrets) : DeviceSecret;} + {_clusterWitnessType = If( json?.PropertyT("clusterWitnessType"), out var __jsonClusterWitnessType) ? (string)__jsonClusterWitnessType : (string)ClusterWitnessType;} + {_fileShareWitnessLocation = If( json?.PropertyT("fileShareWitnessLocation"), out var __jsonFileShareWitnessLocation) ? (string)__jsonFileShareWitnessLocation : (string)FileShareWitnessLocation;} + {_fileShareWitnessUsername = If( json?.PropertyT("fileShareWitnessUsername"), out var __jsonFileShareWitnessUsername) ? (string)__jsonFileShareWitnessUsername : (string)FileShareWitnessUsername;} + {_cloudWitnessStorageAccountName = If( json?.PropertyT("cloudWitnessStorageAccountName"), out var __jsonCloudWitnessStorageAccountName) ? (string)__jsonCloudWitnessStorageAccountName : (string)CloudWitnessStorageAccountName;} + {_cloudWitnessContainerName = If( json?.PropertyT("cloudWitnessContainerName"), out var __jsonCloudWitnessContainerName) ? (string)__jsonCloudWitnessContainerName : (string)CloudWitnessContainerName;} + {_cloudWitnessStorageEndpoint = If( json?.PropertyT("cloudWitnessStorageEndpoint"), out var __jsonCloudWitnessStorageEndpoint) ? (string)__jsonCloudWitnessStorageEndpoint : (string)CloudWitnessStorageEndpoint;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DataBoxEdgeDeviceExtendedInfoProperties(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._encryptionKeyThumbprint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._encryptionKeyThumbprint.ToString()) : null, "encryptionKeyThumbprint" ,container.Add ); + AddIf( null != (((object)this._encryptionKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._encryptionKey.ToString()) : null, "encryptionKey" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._resourceKey.ToString()) : null, "resourceKey" ,container.Add ); + } + AddIf( null != (((object)this._clientSecretStoreId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._clientSecretStoreId.ToString()) : null, "clientSecretStoreId" ,container.Add ); + AddIf( null != (((object)this._clientSecretStoreUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._clientSecretStoreUrl.ToString()) : null, "clientSecretStoreUrl" ,container.Add ); + AddIf( null != (((object)this._channelIntegrityKeyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._channelIntegrityKeyName.ToString()) : null, "channelIntegrityKeyName" ,container.Add ); + AddIf( null != (((object)this._channelIntegrityKeyVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._channelIntegrityKeyVersion.ToString()) : null, "channelIntegrityKeyVersion" ,container.Add ); + AddIf( null != (((object)this._keyVaultSyncStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._keyVaultSyncStatus.ToString()) : null, "keyVaultSyncStatus" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._deviceSecret ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._deviceSecret.ToJson(null,serializationMode) : null, "deviceSecrets" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._clusterWitnessType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._clusterWitnessType.ToString()) : null, "clusterWitnessType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._fileShareWitnessLocation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._fileShareWitnessLocation.ToString()) : null, "fileShareWitnessLocation" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._fileShareWitnessUsername)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._fileShareWitnessUsername.ToString()) : null, "fileShareWitnessUsername" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._cloudWitnessStorageAccountName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._cloudWitnessStorageAccountName.ToString()) : null, "cloudWitnessStorageAccountName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._cloudWitnessContainerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._cloudWitnessContainerName.ToString()) : null, "cloudWitnessContainerName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._cloudWitnessStorageEndpoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._cloudWitnessStorageEndpoint.ToString()) : null, "cloudWitnessStorageEndpoint" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets.PowerShell.cs new file mode 100644 index 000000000000..1d8bbf6aad7b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets.PowerShell.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Device secrets, will be returned only with ODataFilter $expand=deviceSecrets + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecretsTypeConverter))] + public partial class DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets + { + + /// + /// 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 DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets(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 DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Device secrets, will be returned only with ODataFilter $expand=deviceSecrets + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecretsTypeConverter))] + public partial interface IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets.TypeConverter.cs new file mode 100644 index 000000000000..6b24b1927432 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets.TypeConverter.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecretsTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets.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/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets.cs new file mode 100644 index 000000000000..56152c807bbc --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Device secrets, will be returned only with ODataFilter $expand=deviceSecrets + public partial class DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecretsInternal + { + + /// + /// Creates an new instance. + /// + public DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets() + { + + } + } + /// Device secrets, will be returned only with ODataFilter $expand=deviceSecrets + public partial interface IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray + { + + } + /// Device secrets, will be returned only with ODataFilter $expand=deviceSecrets + internal partial interface IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecretsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets.dictionary.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets.dictionary.cs new file mode 100644 index 000000000000..106a63c60fd2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + public partial class DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecret this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecret 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.DataBoxEdge.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.DataBoxEdge.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 Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecret value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets.json.cs new file mode 100644 index 000000000000..cf1944e7816a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Device secrets, will be returned only with ODataFilter $expand=deviceSecrets + public partial class DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + /// + internal DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Secret.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DataBoxEdgeDeviceExtendedInfoPropertiesDeviceSecrets(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceList.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceList.PowerShell.cs new file mode 100644 index 000000000000..b8a419021b1b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The collection of Data Box Edge/Gateway devices. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDeviceListTypeConverter))] + public partial class DataBoxEdgeDeviceList + { + + /// + /// 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 DataBoxEdgeDeviceList(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceListInternal)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 DataBoxEdgeDeviceList(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceListInternal)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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataBoxEdgeDeviceList(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataBoxEdgeDeviceList(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The collection of Data Box Edge/Gateway devices. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDeviceListTypeConverter))] + public partial interface IDataBoxEdgeDeviceList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceList.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceList.TypeConverter.cs new file mode 100644 index 000000000000..0a4a34fca4d2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataBoxEdgeDeviceListTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataBoxEdgeDeviceList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataBoxEdgeDeviceList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataBoxEdgeDeviceList.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/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceList.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceList.cs new file mode 100644 index 000000000000..2603b05f1f17 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceList.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The collection of Data Box Edge/Gateway devices. + public partial class DataBoxEdgeDeviceList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceList, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceListInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice[] _value; + + /// The list of Data Box Edge/Gateway devices. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice[] Value { get => this._value; } + + /// Creates an new instance. + public DataBoxEdgeDeviceList() + { + + } + } + /// The collection of Data Box Edge/Gateway devices. + public partial interface IDataBoxEdgeDeviceList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Link to the next set of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of Data Box Edge/Gateway devices. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of Data Box Edge/Gateway devices.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice[] Value { get; } + + } + /// The collection of Data Box Edge/Gateway devices. + internal partial interface IDataBoxEdgeDeviceListInternal + + { + /// Link to the next set of results. + string NextLink { get; set; } + /// The list of Data Box Edge/Gateway devices. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceList.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceList.json.cs new file mode 100644 index 000000000000..7edee43c6689 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceList.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The collection of Data Box Edge/Gateway devices. + public partial class DataBoxEdgeDeviceList + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DataBoxEdgeDeviceList(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevice.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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DataBoxEdgeDeviceList(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatch.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatch.PowerShell.cs new file mode 100644 index 000000000000..01b4f6c0dc50 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatch.PowerShell.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The Data Box Edge/Gateway device patch. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDevicePatchTypeConverter))] + public partial class DataBoxEdgeDevicePatch + { + + /// + /// 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 DataBoxEdgeDevicePatch(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatch) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevicePropertiesPatchTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevicePatchTagsTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("EdgeProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).EdgeProfile = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatch) content.GetValueForProperty("EdgeProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).EdgeProfile, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfilePatchTypeConverter.ConvertFrom); + } + if (content.Contains("EdgeProfileSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).EdgeProfileSubscription = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch) content.GetValueForProperty("EdgeProfileSubscription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).EdgeProfileSubscription, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionPatchTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).SubscriptionId, 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 DataBoxEdgeDevicePatch(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatch) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevicePropertiesPatchTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevicePatchTagsTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("EdgeProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).EdgeProfile = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatch) content.GetValueForProperty("EdgeProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).EdgeProfile, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfilePatchTypeConverter.ConvertFrom); + } + if (content.Contains("EdgeProfileSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).EdgeProfileSubscription = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch) content.GetValueForProperty("EdgeProfileSubscription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).EdgeProfileSubscription, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionPatchTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal)this).SubscriptionId, 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatch DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataBoxEdgeDevicePatch(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataBoxEdgeDevicePatch(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Data Box Edge/Gateway device patch. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDevicePatchTypeConverter))] + public partial interface IDataBoxEdgeDevicePatch + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatch.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatch.TypeConverter.cs new file mode 100644 index 000000000000..23dc9f0569a7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatch.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataBoxEdgeDevicePatchTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatch ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatch).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataBoxEdgeDevicePatch.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataBoxEdgeDevicePatch.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataBoxEdgeDevicePatch.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/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatch.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatch.cs new file mode 100644 index 000000000000..19325393e9a6 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatch.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The Data Box Edge/Gateway device patch. + public partial class DataBoxEdgeDevicePatch : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatch, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentity _identity; + + /// Msi identity of the resource + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceIdentity()); set => this._identity = value; } + + /// Service Principal Id backing the Msi + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)Identity).PrincipalId; } + + /// Home Tenant Id + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)Identity).TenantId; } + + /// Identity type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType)""); } + + /// Internal Acessors for EdgeProfile + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatch Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal.EdgeProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal)Property).EdgeProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal)Property).EdgeProfile = value; } + + /// Internal Acessors for EdgeProfileSubscription + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal.EdgeProfileSubscription { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal)Property).EdgeProfileSubscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal)Property).EdgeProfileSubscription = value; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentity Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceIdentity()); set { {_identity = value;} } } + + /// Internal Acessors for IdentityPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)Identity).PrincipalId = value; } + + /// Internal Acessors for IdentityTenantId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)Identity).TenantId = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatch Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevicePropertiesPatch()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatch _property; + + /// The properties associated with the Data Box Edge/Gateway resource + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatch Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevicePropertiesPatch()); set => this._property = value; } + + /// The path ID that uniquely identifies the subscription of the edge profile. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal)Property).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal)Property).SubscriptionId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags _tag; + + /// The tags attached to the Data Box Edge/Gateway resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevicePatchTags()); set => this._tag = value; } + + /// Creates an new instance. + public DataBoxEdgeDevicePatch() + { + + } + } + /// The Data Box Edge/Gateway device patch. + public partial interface IDataBoxEdgeDevicePatch : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Service Principal Id backing the Msi + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Service Principal Id backing the Msi", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string IdentityPrincipalId { get; } + /// Home Tenant Id + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Home Tenant Id", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string IdentityTenantId { get; } + /// Identity type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identity type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType? IdentityType { get; set; } + /// The path ID that uniquely identifies the subscription of the edge profile. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The path ID that uniquely identifies the subscription of the edge profile.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + /// The tags attached to the Data Box Edge/Gateway resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tags attached to the Data Box Edge/Gateway resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags Tag { get; set; } + + } + /// The Data Box Edge/Gateway device patch. + internal partial interface IDataBoxEdgeDevicePatchInternal + + { + /// Edge Profile property of the Data Box Edge/Gateway device + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatch EdgeProfile { get; set; } + /// The Data Box Edge/Gateway Edge Profile Subscription patch + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch EdgeProfileSubscription { get; set; } + /// Msi identity of the resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentity Identity { get; set; } + /// Service Principal Id backing the Msi + string IdentityPrincipalId { get; set; } + /// Home Tenant Id + string IdentityTenantId { get; set; } + /// Identity type + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType? IdentityType { get; set; } + /// The properties associated with the Data Box Edge/Gateway resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatch Property { get; set; } + /// The path ID that uniquely identifies the subscription of the edge profile. + string SubscriptionId { get; set; } + /// The tags attached to the Data Box Edge/Gateway resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatch.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatch.json.cs new file mode 100644 index 000000000000..4fff9f7099d7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatch.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The Data Box Edge/Gateway device patch. + public partial class DataBoxEdgeDevicePatch + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DataBoxEdgeDevicePatch(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceIdentity.FromJson(__jsonIdentity) : Identity;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevicePropertiesPatch.FromJson(__jsonProperties) : Property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevicePatchTags.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatch. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatch. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DataBoxEdgeDevicePatch(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatchTags.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatchTags.PowerShell.cs new file mode 100644 index 000000000000..f63fabcde379 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatchTags.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The tags attached to the Data Box Edge/Gateway resource. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDevicePatchTagsTypeConverter))] + public partial class DataBoxEdgeDevicePatchTags + { + + /// + /// 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 DataBoxEdgeDevicePatchTags(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 DataBoxEdgeDevicePatchTags(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataBoxEdgeDevicePatchTags(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataBoxEdgeDevicePatchTags(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The tags attached to the Data Box Edge/Gateway resource. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDevicePatchTagsTypeConverter))] + public partial interface IDataBoxEdgeDevicePatchTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatchTags.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatchTags.TypeConverter.cs new file mode 100644 index 000000000000..47eca07df554 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatchTags.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataBoxEdgeDevicePatchTagsTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataBoxEdgeDevicePatchTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataBoxEdgeDevicePatchTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataBoxEdgeDevicePatchTags.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/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatchTags.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatchTags.cs new file mode 100644 index 000000000000..d2b98f6c375c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatchTags.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The tags attached to the Data Box Edge/Gateway resource. + public partial class DataBoxEdgeDevicePatchTags : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTagsInternal + { + + /// Creates an new instance. + public DataBoxEdgeDevicePatchTags() + { + + } + } + /// The tags attached to the Data Box Edge/Gateway resource. + public partial interface IDataBoxEdgeDevicePatchTags : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray + { + + } + /// The tags attached to the Data Box Edge/Gateway resource. + internal partial interface IDataBoxEdgeDevicePatchTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatchTags.dictionary.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatchTags.dictionary.cs new file mode 100644 index 000000000000..2f3bb5ed3ae7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatchTags.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + public partial class DataBoxEdgeDevicePatchTags : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevicePatchTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatchTags.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatchTags.json.cs new file mode 100644 index 000000000000..8c8ca1d7c9f5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePatchTags.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The tags attached to the Data Box Edge/Gateway resource. + public partial class DataBoxEdgeDevicePatchTags + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + /// + internal DataBoxEdgeDevicePatchTags(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DataBoxEdgeDevicePatchTags(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceProperties.PowerShell.cs new file mode 100644 index 000000000000..356df41346dd --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceProperties.PowerShell.cs @@ -0,0 +1,448 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The properties of the Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDevicePropertiesTypeConverter))] + public partial class DataBoxEdgeDeviceProperties + { + + /// + /// 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 DataBoxEdgeDeviceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceMoveDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ResourceMoveDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetails) content.GetValueForProperty("ResourceMoveDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ResourceMoveDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceMoveDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("EdgeProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).EdgeProfile = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile) content.GetValueForProperty("EdgeProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).EdgeProfile, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileTypeConverter.ConvertFrom); + } + if (content.Contains("DataResidency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DataResidency = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidency) content.GetValueForProperty("DataResidency",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DataResidency, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataResidencyTypeConverter.ConvertFrom); + } + if (content.Contains("DataBoxEdgeDeviceStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DataBoxEdgeDeviceStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus?) content.GetValueForProperty("DataBoxEdgeDeviceStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DataBoxEdgeDeviceStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus.CreateFrom); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ModelDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ModelDescription = (string) content.GetValueForProperty("ModelDescription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ModelDescription, global::System.Convert.ToString); + } + if (content.Contains("DeviceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType?) content.GetValueForProperty("DeviceType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType.CreateFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("Culture")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).Culture = (string) content.GetValueForProperty("Culture",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).Culture, global::System.Convert.ToString); + } + if (content.Contains("DeviceModel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceModel = (string) content.GetValueForProperty("DeviceModel",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceModel, global::System.Convert.ToString); + } + if (content.Contains("DeviceSoftwareVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceSoftwareVersion = (string) content.GetValueForProperty("DeviceSoftwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceSoftwareVersion, global::System.Convert.ToString); + } + if (content.Contains("DeviceLocalCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceLocalCapacity = (long?) content.GetValueForProperty("DeviceLocalCapacity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceLocalCapacity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TimeZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).TimeZone, global::System.Convert.ToString); + } + if (content.Contains("DeviceHcsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceHcsVersion = (string) content.GetValueForProperty("DeviceHcsVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceHcsVersion, global::System.Convert.ToString); + } + if (content.Contains("ConfiguredRoleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ConfiguredRoleType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes[]) content.GetValueForProperty("ConfiguredRoleType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ConfiguredRoleType, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes.CreateFrom)); + } + if (content.Contains("NodeCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).NodeCount = (int?) content.GetValueForProperty("NodeCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).NodeCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EdgeProfileSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).EdgeProfileSubscription = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription) content.GetValueForProperty("EdgeProfileSubscription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).EdgeProfileSubscription, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionTypeConverter.ConvertFrom); + } + if (content.Contains("DataResidencyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DataResidencyType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType?) content.GetValueForProperty("DataResidencyType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DataResidencyType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ResourceMoveDetailOperationInProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ResourceMoveDetailOperationInProgress = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus?) content.GetValueForProperty("ResourceMoveDetailOperationInProgress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ResourceMoveDetailOperationInProgress, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus.CreateFrom); + } + if (content.Contains("ResourceMoveDetailOperationInProgressLockTimeoutInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ResourceMoveDetailOperationInProgressLockTimeoutInUtc = (global::System.DateTime?) content.GetValueForProperty("ResourceMoveDetailOperationInProgressLockTimeoutInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ResourceMoveDetailOperationInProgressLockTimeoutInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SubscriptionProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionProperty = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties) content.GetValueForProperty("SubscriptionProperty",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionProperty, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState?) content.GetValueForProperty("SubscriptionState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState.CreateFrom); + } + if (content.Contains("SubscriptionRegistrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionRegistrationId = (string) content.GetValueForProperty("SubscriptionRegistrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionRegistrationId, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionRegistrationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionRegistrationDate = (string) content.GetValueForProperty("SubscriptionRegistrationDate",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionRegistrationDate, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("QuotaId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).QuotaId = (string) content.GetValueForProperty("QuotaId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).QuotaId, global::System.Convert.ToString); + } + if (content.Contains("SerializedDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SerializedDetail = (string) content.GetValueForProperty("SerializedDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SerializedDetail, global::System.Convert.ToString); + } + if (content.Contains("RegisteredFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).RegisteredFeature = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[]) content.GetValueForProperty("RegisteredFeature",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).RegisteredFeature, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionRegisteredFeaturesTypeConverter.ConvertFrom)); + } + if (content.Contains("LocationPlacementId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).LocationPlacementId = (string) content.GetValueForProperty("LocationPlacementId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).LocationPlacementId, 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 DataBoxEdgeDeviceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceMoveDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ResourceMoveDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetails) content.GetValueForProperty("ResourceMoveDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ResourceMoveDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceMoveDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("EdgeProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).EdgeProfile = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile) content.GetValueForProperty("EdgeProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).EdgeProfile, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileTypeConverter.ConvertFrom); + } + if (content.Contains("DataResidency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DataResidency = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidency) content.GetValueForProperty("DataResidency",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DataResidency, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataResidencyTypeConverter.ConvertFrom); + } + if (content.Contains("DataBoxEdgeDeviceStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DataBoxEdgeDeviceStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus?) content.GetValueForProperty("DataBoxEdgeDeviceStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DataBoxEdgeDeviceStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus.CreateFrom); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ModelDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ModelDescription = (string) content.GetValueForProperty("ModelDescription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ModelDescription, global::System.Convert.ToString); + } + if (content.Contains("DeviceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType?) content.GetValueForProperty("DeviceType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType.CreateFrom); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("Culture")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).Culture = (string) content.GetValueForProperty("Culture",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).Culture, global::System.Convert.ToString); + } + if (content.Contains("DeviceModel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceModel = (string) content.GetValueForProperty("DeviceModel",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceModel, global::System.Convert.ToString); + } + if (content.Contains("DeviceSoftwareVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceSoftwareVersion = (string) content.GetValueForProperty("DeviceSoftwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceSoftwareVersion, global::System.Convert.ToString); + } + if (content.Contains("DeviceLocalCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceLocalCapacity = (long?) content.GetValueForProperty("DeviceLocalCapacity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceLocalCapacity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TimeZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).TimeZone, global::System.Convert.ToString); + } + if (content.Contains("DeviceHcsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceHcsVersion = (string) content.GetValueForProperty("DeviceHcsVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DeviceHcsVersion, global::System.Convert.ToString); + } + if (content.Contains("ConfiguredRoleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ConfiguredRoleType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes[]) content.GetValueForProperty("ConfiguredRoleType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ConfiguredRoleType, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes.CreateFrom)); + } + if (content.Contains("NodeCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).NodeCount = (int?) content.GetValueForProperty("NodeCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).NodeCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EdgeProfileSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).EdgeProfileSubscription = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription) content.GetValueForProperty("EdgeProfileSubscription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).EdgeProfileSubscription, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionTypeConverter.ConvertFrom); + } + if (content.Contains("DataResidencyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DataResidencyType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType?) content.GetValueForProperty("DataResidencyType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).DataResidencyType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ResourceMoveDetailOperationInProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ResourceMoveDetailOperationInProgress = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus?) content.GetValueForProperty("ResourceMoveDetailOperationInProgress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ResourceMoveDetailOperationInProgress, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus.CreateFrom); + } + if (content.Contains("ResourceMoveDetailOperationInProgressLockTimeoutInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ResourceMoveDetailOperationInProgressLockTimeoutInUtc = (global::System.DateTime?) content.GetValueForProperty("ResourceMoveDetailOperationInProgressLockTimeoutInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).ResourceMoveDetailOperationInProgressLockTimeoutInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SubscriptionProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionProperty = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties) content.GetValueForProperty("SubscriptionProperty",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionProperty, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState?) content.GetValueForProperty("SubscriptionState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState.CreateFrom); + } + if (content.Contains("SubscriptionRegistrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionRegistrationId = (string) content.GetValueForProperty("SubscriptionRegistrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionRegistrationId, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionRegistrationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionRegistrationDate = (string) content.GetValueForProperty("SubscriptionRegistrationDate",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionRegistrationDate, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("QuotaId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).QuotaId = (string) content.GetValueForProperty("QuotaId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).QuotaId, global::System.Convert.ToString); + } + if (content.Contains("SerializedDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SerializedDetail = (string) content.GetValueForProperty("SerializedDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).SerializedDetail, global::System.Convert.ToString); + } + if (content.Contains("RegisteredFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).RegisteredFeature = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[]) content.GetValueForProperty("RegisteredFeature",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).RegisteredFeature, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionRegisteredFeaturesTypeConverter.ConvertFrom)); + } + if (content.Contains("LocationPlacementId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).LocationPlacementId = (string) content.GetValueForProperty("LocationPlacementId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal)this).LocationPlacementId, 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataBoxEdgeDeviceProperties(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataBoxEdgeDeviceProperties(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDevicePropertiesTypeConverter))] + public partial interface IDataBoxEdgeDeviceProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceProperties.TypeConverter.cs new file mode 100644 index 000000000000..8ed1195a21d8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataBoxEdgeDevicePropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataBoxEdgeDeviceProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataBoxEdgeDeviceProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataBoxEdgeDeviceProperties.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/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceProperties.cs new file mode 100644 index 000000000000..5e7ded1091c1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceProperties.cs @@ -0,0 +1,630 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The properties of the Data Box Edge/Gateway device. + public partial class DataBoxEdgeDeviceProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes[] _configuredRoleType; + + /// Type of compute roles configured. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes[] ConfiguredRoleType { get => this._configuredRoleType; } + + /// Backing field for property. + private string _culture; + + /// The Data Box Edge/Gateway device culture. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Culture { get => this._culture; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus? _dataBoxEdgeDeviceStatus; + + /// The status of the Data Box Edge/Gateway device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus? DataBoxEdgeDeviceStatus { get => this._dataBoxEdgeDeviceStatus; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidency _dataResidency; + + /// The details of data-residency related properties for this resource + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidency DataResidency { get => (this._dataResidency = this._dataResidency ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataResidency()); set => this._dataResidency = value; } + + /// DataResidencyType enum + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType? DataResidencyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidencyInternal)DataResidency).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidencyInternal)DataResidency).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType)""); } + + /// Backing field for property. + private string _description; + + /// The Description of the Data Box Edge/Gateway device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Description { get => this._description; } + + /// Backing field for property. + private string _deviceHcsVersion; + + /// The device software version number of the device (eg: 1.2.18105.6). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string DeviceHcsVersion { get => this._deviceHcsVersion; } + + /// Backing field for property. + private long? _deviceLocalCapacity; + + /// The Data Box Edge/Gateway device local capacity in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public long? DeviceLocalCapacity { get => this._deviceLocalCapacity; } + + /// Backing field for property. + private string _deviceModel; + + /// The Data Box Edge/Gateway device model. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string DeviceModel { get => this._deviceModel; } + + /// Backing field for property. + private string _deviceSoftwareVersion; + + /// The Data Box Edge/Gateway device software version. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string DeviceSoftwareVersion { get => this._deviceSoftwareVersion; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType? _deviceType; + + /// The type of the Data Box Edge/Gateway device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType? DeviceType { get => this._deviceType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile _edgeProfile; + + /// The details of Edge Profile for this resource + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile EdgeProfile { get => (this._edgeProfile = this._edgeProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfile()); } + + /// Backing field for property. + private string _friendlyName; + + /// The Data Box Edge/Gateway device name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string FriendlyName { get => this._friendlyName; } + + /// ARM ID of the subscription + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).Id = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string LocationPlacementId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).LocationPlacementId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).LocationPlacementId = value ?? null; } + + /// Internal Acessors for ConfiguredRoleType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.ConfiguredRoleType { get => this._configuredRoleType; set { {_configuredRoleType = value;} } } + + /// Internal Acessors for Culture + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.Culture { get => this._culture; set { {_culture = value;} } } + + /// Internal Acessors for DataBoxEdgeDeviceStatus + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.DataBoxEdgeDeviceStatus { get => this._dataBoxEdgeDeviceStatus; set { {_dataBoxEdgeDeviceStatus = value;} } } + + /// Internal Acessors for DataResidency + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidency Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.DataResidency { get => (this._dataResidency = this._dataResidency ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataResidency()); set { {_dataResidency = value;} } } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for DeviceHcsVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.DeviceHcsVersion { get => this._deviceHcsVersion; set { {_deviceHcsVersion = value;} } } + + /// Internal Acessors for DeviceLocalCapacity + long? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.DeviceLocalCapacity { get => this._deviceLocalCapacity; set { {_deviceLocalCapacity = value;} } } + + /// Internal Acessors for DeviceModel + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.DeviceModel { get => this._deviceModel; set { {_deviceModel = value;} } } + + /// Internal Acessors for DeviceSoftwareVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.DeviceSoftwareVersion { get => this._deviceSoftwareVersion; set { {_deviceSoftwareVersion = value;} } } + + /// Internal Acessors for DeviceType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.DeviceType { get => this._deviceType; set { {_deviceType = value;} } } + + /// Internal Acessors for EdgeProfile + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.EdgeProfile { get => (this._edgeProfile = this._edgeProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfile()); set { {_edgeProfile = value;} } } + + /// Internal Acessors for EdgeProfileSubscription + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.EdgeProfileSubscription { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).Subscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).Subscription = value; } + + /// Internal Acessors for FriendlyName + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.FriendlyName { get => this._friendlyName; set { {_friendlyName = value;} } } + + /// Internal Acessors for ModelDescription + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.ModelDescription { get => this._modelDescription; set { {_modelDescription = value;} } } + + /// Internal Acessors for NodeCount + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.NodeCount { get => this._nodeCount; set { {_nodeCount = value;} } } + + /// Internal Acessors for ResourceMoveDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetails Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.ResourceMoveDetail { get => (this._resourceMoveDetail = this._resourceMoveDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceMoveDetails()); set { {_resourceMoveDetail = value;} } } + + /// Internal Acessors for SerialNumber + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.SerialNumber { get => this._serialNumber; set { {_serialNumber = value;} } } + + /// Internal Acessors for SubscriptionProperty + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.SubscriptionProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionProperty = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for TimeZone + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesInternal.TimeZone { get => this._timeZone; set { {_timeZone = value;} } } + + /// Backing field for property. + private string _modelDescription; + + /// The description of the Data Box Edge/Gateway device model. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ModelDescription { get => this._modelDescription; } + + /// Backing field for property. + private int? _nodeCount; + + /// The number of nodes in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? NodeCount { get => this._nodeCount; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string QuotaId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).QuotaId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).QuotaId = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).RegisteredFeature; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).RegisteredFeature = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetails _resourceMoveDetail; + + /// The details of the move operation on this resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetails ResourceMoveDetail { get => (this._resourceMoveDetail = this._resourceMoveDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceMoveDetails()); } + + /// Denotes whether move operation is in progress + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus? ResourceMoveDetailOperationInProgress { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetailsInternal)ResourceMoveDetail).OperationInProgress; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetailsInternal)ResourceMoveDetail).OperationInProgress = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus)""); } + + /// Denotes the timeout of the operation to finish + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? ResourceMoveDetailOperationInProgressLockTimeoutInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetailsInternal)ResourceMoveDetail).OperationInProgressLockTimeoutInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetailsInternal)ResourceMoveDetail).OperationInProgressLockTimeoutInUtc = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private string _serialNumber; + + /// The Serial Number of Data Box Edge/Gateway device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string SerialNumber { get => this._serialNumber; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SerializedDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SerializedDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SerializedDetail = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionId = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SubscriptionRegistrationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionRegistrationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionRegistrationDate = value ?? null; } + + /// Edge Subscription Registration ID + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SubscriptionRegistrationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionRegistrationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionRegistrationId = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState? SubscriptionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).SubscriptionState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// DataBoxEdge Device Properties + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)EdgeProfile).TenantId = value ?? null; } + + /// Backing field for property. + private string _timeZone; + + /// The Data Box Edge/Gateway device timezone. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string TimeZone { get => this._timeZone; } + + /// Creates an new instance. + public DataBoxEdgeDeviceProperties() + { + + } + } + /// The properties of the Data Box Edge/Gateway device. + public partial interface IDataBoxEdgeDeviceProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Type of compute roles configured. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of compute roles configured.", + SerializedName = @"configuredRoleTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes[] ConfiguredRoleType { get; } + /// The Data Box Edge/Gateway device culture. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Data Box Edge/Gateway device culture.", + SerializedName = @"culture", + PossibleTypes = new [] { typeof(string) })] + string Culture { get; } + /// The status of the Data Box Edge/Gateway device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The status of the Data Box Edge/Gateway device.", + SerializedName = @"dataBoxEdgeDeviceStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus? DataBoxEdgeDeviceStatus { get; } + /// DataResidencyType enum + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DataResidencyType enum", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType? DataResidencyType { get; set; } + /// The Description of the Data Box Edge/Gateway device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Description of the Data Box Edge/Gateway device.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// The device software version number of the device (eg: 1.2.18105.6). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The device software version number of the device (eg: 1.2.18105.6).", + SerializedName = @"deviceHcsVersion", + PossibleTypes = new [] { typeof(string) })] + string DeviceHcsVersion { get; } + /// The Data Box Edge/Gateway device local capacity in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Data Box Edge/Gateway device local capacity in MB.", + SerializedName = @"deviceLocalCapacity", + PossibleTypes = new [] { typeof(long) })] + long? DeviceLocalCapacity { get; } + /// The Data Box Edge/Gateway device model. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Data Box Edge/Gateway device model.", + SerializedName = @"deviceModel", + PossibleTypes = new [] { typeof(string) })] + string DeviceModel { get; } + /// The Data Box Edge/Gateway device software version. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Data Box Edge/Gateway device software version.", + SerializedName = @"deviceSoftwareVersion", + PossibleTypes = new [] { typeof(string) })] + string DeviceSoftwareVersion { get; } + /// The type of the Data Box Edge/Gateway device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of the Data Box Edge/Gateway device.", + SerializedName = @"deviceType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType? DeviceType { get; } + /// The Data Box Edge/Gateway device name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Data Box Edge/Gateway device name.", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; } + /// ARM ID of the subscription + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ARM ID of the subscription", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"locationPlacementId", + PossibleTypes = new [] { typeof(string) })] + string LocationPlacementId { get; set; } + /// The description of the Data Box Edge/Gateway device model. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The description of the Data Box Edge/Gateway device model.", + SerializedName = @"modelDescription", + PossibleTypes = new [] { typeof(string) })] + string ModelDescription { get; } + /// The number of nodes in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The number of nodes in the cluster.", + SerializedName = @"nodeCount", + PossibleTypes = new [] { typeof(int) })] + int? NodeCount { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"quotaId", + PossibleTypes = new [] { typeof(string) })] + string QuotaId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"registeredFeatures", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get; set; } + /// Denotes whether move operation is in progress + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Denotes whether move operation is in progress", + SerializedName = @"operationInProgress", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus? ResourceMoveDetailOperationInProgress { get; set; } + /// Denotes the timeout of the operation to finish + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Denotes the timeout of the operation to finish", + SerializedName = @"operationInProgressLockTimeoutInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ResourceMoveDetailOperationInProgressLockTimeoutInUtc { get; set; } + /// The Serial Number of Data Box Edge/Gateway device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Serial Number of Data Box Edge/Gateway device.", + SerializedName = @"serialNumber", + PossibleTypes = new [] { typeof(string) })] + string SerialNumber { get; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"serializedDetails", + PossibleTypes = new [] { typeof(string) })] + string SerializedDetail { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"registrationDate", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionRegistrationDate { get; set; } + /// Edge Subscription Registration ID + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Edge Subscription Registration ID", + SerializedName = @"registrationId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionRegistrationId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState? SubscriptionState { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; set; } + /// The Data Box Edge/Gateway device timezone. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Data Box Edge/Gateway device timezone.", + SerializedName = @"timeZone", + PossibleTypes = new [] { typeof(string) })] + string TimeZone { get; } + + } + /// The properties of the Data Box Edge/Gateway device. + internal partial interface IDataBoxEdgeDevicePropertiesInternal + + { + /// Type of compute roles configured. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes[] ConfiguredRoleType { get; set; } + /// The Data Box Edge/Gateway device culture. + string Culture { get; set; } + /// The status of the Data Box Edge/Gateway device. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus? DataBoxEdgeDeviceStatus { get; set; } + /// The details of data-residency related properties for this resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidency DataResidency { get; set; } + /// DataResidencyType enum + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType? DataResidencyType { get; set; } + /// The Description of the Data Box Edge/Gateway device. + string Description { get; set; } + /// The device software version number of the device (eg: 1.2.18105.6). + string DeviceHcsVersion { get; set; } + /// The Data Box Edge/Gateway device local capacity in MB. + long? DeviceLocalCapacity { get; set; } + /// The Data Box Edge/Gateway device model. + string DeviceModel { get; set; } + /// The Data Box Edge/Gateway device software version. + string DeviceSoftwareVersion { get; set; } + /// The type of the Data Box Edge/Gateway device. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType? DeviceType { get; set; } + /// The details of Edge Profile for this resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile EdgeProfile { get; set; } + /// Edge Profile Subscription + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription EdgeProfileSubscription { get; set; } + /// The Data Box Edge/Gateway device name. + string FriendlyName { get; set; } + /// ARM ID of the subscription + string Id { get; set; } + + string LocationPlacementId { get; set; } + /// The description of the Data Box Edge/Gateway device model. + string ModelDescription { get; set; } + /// The number of nodes in the cluster. + int? NodeCount { get; set; } + + string QuotaId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get; set; } + /// The details of the move operation on this resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetails ResourceMoveDetail { get; set; } + /// Denotes whether move operation is in progress + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus? ResourceMoveDetailOperationInProgress { get; set; } + /// Denotes the timeout of the operation to finish + global::System.DateTime? ResourceMoveDetailOperationInProgressLockTimeoutInUtc { get; set; } + /// The Serial Number of Data Box Edge/Gateway device. + string SerialNumber { get; set; } + + string SerializedDetail { get; set; } + + string SubscriptionId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties SubscriptionProperty { get; set; } + + string SubscriptionRegistrationDate { get; set; } + /// Edge Subscription Registration ID + string SubscriptionRegistrationId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState? SubscriptionState { get; set; } + /// DataBoxEdge Device Properties + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + string TenantId { get; set; } + /// The Data Box Edge/Gateway device timezone. + string TimeZone { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceProperties.json.cs new file mode 100644 index 000000000000..7d16a255d21e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceProperties.json.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The properties of the Data Box Edge/Gateway device. + public partial class DataBoxEdgeDeviceProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DataBoxEdgeDeviceProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_resourceMoveDetail = If( json?.PropertyT("resourceMoveDetails"), out var __jsonResourceMoveDetails) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ResourceMoveDetails.FromJson(__jsonResourceMoveDetails) : ResourceMoveDetail;} + {_edgeProfile = If( json?.PropertyT("edgeProfile"), out var __jsonEdgeProfile) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfile.FromJson(__jsonEdgeProfile) : EdgeProfile;} + {_dataResidency = If( json?.PropertyT("dataResidency"), out var __jsonDataResidency) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataResidency.FromJson(__jsonDataResidency) : DataResidency;} + {_dataBoxEdgeDeviceStatus = If( json?.PropertyT("dataBoxEdgeDeviceStatus"), out var __jsonDataBoxEdgeDeviceStatus) ? (string)__jsonDataBoxEdgeDeviceStatus : (string)DataBoxEdgeDeviceStatus;} + {_serialNumber = If( json?.PropertyT("serialNumber"), out var __jsonSerialNumber) ? (string)__jsonSerialNumber : (string)SerialNumber;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_modelDescription = If( json?.PropertyT("modelDescription"), out var __jsonModelDescription) ? (string)__jsonModelDescription : (string)ModelDescription;} + {_deviceType = If( json?.PropertyT("deviceType"), out var __jsonDeviceType) ? (string)__jsonDeviceType : (string)DeviceType;} + {_friendlyName = If( json?.PropertyT("friendlyName"), out var __jsonFriendlyName) ? (string)__jsonFriendlyName : (string)FriendlyName;} + {_culture = If( json?.PropertyT("culture"), out var __jsonCulture) ? (string)__jsonCulture : (string)Culture;} + {_deviceModel = If( json?.PropertyT("deviceModel"), out var __jsonDeviceModel) ? (string)__jsonDeviceModel : (string)DeviceModel;} + {_deviceSoftwareVersion = If( json?.PropertyT("deviceSoftwareVersion"), out var __jsonDeviceSoftwareVersion) ? (string)__jsonDeviceSoftwareVersion : (string)DeviceSoftwareVersion;} + {_deviceLocalCapacity = If( json?.PropertyT("deviceLocalCapacity"), out var __jsonDeviceLocalCapacity) ? (long?)__jsonDeviceLocalCapacity : DeviceLocalCapacity;} + {_timeZone = If( json?.PropertyT("timeZone"), out var __jsonTimeZone) ? (string)__jsonTimeZone : (string)TimeZone;} + {_deviceHcsVersion = If( json?.PropertyT("deviceHcsVersion"), out var __jsonDeviceHcsVersion) ? (string)__jsonDeviceHcsVersion : (string)DeviceHcsVersion;} + {_configuredRoleType = If( json?.PropertyT("configuredRoleTypes"), out var __jsonConfiguredRoleTypes) ? If( __jsonConfiguredRoleTypes as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Support.RoleTypes) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes)""))) ))() : null : ConfiguredRoleType;} + {_nodeCount = If( json?.PropertyT("nodeCount"), out var __jsonNodeCount) ? (int?)__jsonNodeCount : NodeCount;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DataBoxEdgeDeviceProperties(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._resourceMoveDetail ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._resourceMoveDetail.ToJson(null,serializationMode) : null, "resourceMoveDetails" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._edgeProfile ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._edgeProfile.ToJson(null,serializationMode) : null, "edgeProfile" ,container.Add ); + } + AddIf( null != this._dataResidency ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._dataResidency.ToJson(null,serializationMode) : null, "dataResidency" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._dataBoxEdgeDeviceStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._dataBoxEdgeDeviceStatus.ToString()) : null, "dataBoxEdgeDeviceStatus" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._serialNumber)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._serialNumber.ToString()) : null, "serialNumber" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._modelDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._modelDescription.ToString()) : null, "modelDescription" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._deviceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._deviceType.ToString()) : null, "deviceType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._friendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._friendlyName.ToString()) : null, "friendlyName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._culture)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._culture.ToString()) : null, "culture" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._deviceModel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._deviceModel.ToString()) : null, "deviceModel" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._deviceSoftwareVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._deviceSoftwareVersion.ToString()) : null, "deviceSoftwareVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._deviceLocalCapacity ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((long)this._deviceLocalCapacity) : null, "deviceLocalCapacity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._timeZone)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._timeZone.ToString()) : null, "timeZone" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._deviceHcsVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._deviceHcsVersion.ToString()) : null, "deviceHcsVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._configuredRoleType) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._configuredRoleType ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("configuredRoleTypes",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._nodeCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._nodeCount) : null, "nodeCount" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePropertiesPatch.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePropertiesPatch.PowerShell.cs new file mode 100644 index 000000000000..ce300a73026f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePropertiesPatch.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The Data Box Edge/Gateway device properties patch. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDevicePropertiesPatchTypeConverter))] + public partial class DataBoxEdgeDevicePropertiesPatch + { + + /// + /// 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 DataBoxEdgeDevicePropertiesPatch(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EdgeProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal)this).EdgeProfile = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatch) content.GetValueForProperty("EdgeProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal)this).EdgeProfile, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfilePatchTypeConverter.ConvertFrom); + } + if (content.Contains("EdgeProfileSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal)this).EdgeProfileSubscription = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch) content.GetValueForProperty("EdgeProfileSubscription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal)this).EdgeProfileSubscription, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionPatchTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal)this).SubscriptionId, 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 DataBoxEdgeDevicePropertiesPatch(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EdgeProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal)this).EdgeProfile = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatch) content.GetValueForProperty("EdgeProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal)this).EdgeProfile, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfilePatchTypeConverter.ConvertFrom); + } + if (content.Contains("EdgeProfileSubscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal)this).EdgeProfileSubscription = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch) content.GetValueForProperty("EdgeProfileSubscription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal)this).EdgeProfileSubscription, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionPatchTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal)this).SubscriptionId, 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataBoxEdgeDevicePropertiesPatch(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataBoxEdgeDevicePropertiesPatch(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Data Box Edge/Gateway device properties patch. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDevicePropertiesPatchTypeConverter))] + public partial interface IDataBoxEdgeDevicePropertiesPatch + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePropertiesPatch.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePropertiesPatch.TypeConverter.cs new file mode 100644 index 000000000000..20d92b6f8799 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePropertiesPatch.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataBoxEdgeDevicePropertiesPatchTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatch ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatch).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataBoxEdgeDevicePropertiesPatch.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataBoxEdgeDevicePropertiesPatch.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataBoxEdgeDevicePropertiesPatch.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/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePropertiesPatch.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePropertiesPatch.cs new file mode 100644 index 000000000000..7a47e0366a6c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePropertiesPatch.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The Data Box Edge/Gateway device properties patch. + public partial class DataBoxEdgeDevicePropertiesPatch : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatch, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatch _edgeProfile; + + /// Edge Profile property of the Data Box Edge/Gateway device + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatch EdgeProfile { get => (this._edgeProfile = this._edgeProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfilePatch()); set => this._edgeProfile = value; } + + /// Internal Acessors for EdgeProfile + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatch Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal.EdgeProfile { get => (this._edgeProfile = this._edgeProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfilePatch()); set { {_edgeProfile = value;} } } + + /// Internal Acessors for EdgeProfileSubscription + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatchInternal.EdgeProfileSubscription { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatchInternal)EdgeProfile).Subscription; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatchInternal)EdgeProfile).Subscription = value; } + + /// The path ID that uniquely identifies the subscription of the edge profile. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatchInternal)EdgeProfile).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatchInternal)EdgeProfile).SubscriptionId = value ?? null; } + + /// Creates an new instance. + public DataBoxEdgeDevicePropertiesPatch() + { + + } + } + /// The Data Box Edge/Gateway device properties patch. + public partial interface IDataBoxEdgeDevicePropertiesPatch : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The path ID that uniquely identifies the subscription of the edge profile. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The path ID that uniquely identifies the subscription of the edge profile.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + + } + /// The Data Box Edge/Gateway device properties patch. + internal partial interface IDataBoxEdgeDevicePropertiesPatchInternal + + { + /// Edge Profile property of the Data Box Edge/Gateway device + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatch EdgeProfile { get; set; } + /// The Data Box Edge/Gateway Edge Profile Subscription patch + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch EdgeProfileSubscription { get; set; } + /// The path ID that uniquely identifies the subscription of the edge profile. + string SubscriptionId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePropertiesPatch.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePropertiesPatch.json.cs new file mode 100644 index 000000000000..7d6f52acc38c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDevicePropertiesPatch.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The Data Box Edge/Gateway device properties patch. + public partial class DataBoxEdgeDevicePropertiesPatch + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DataBoxEdgeDevicePropertiesPatch(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_edgeProfile = If( json?.PropertyT("edgeProfile"), out var __jsonEdgeProfile) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfilePatch.FromJson(__jsonEdgeProfile) : EdgeProfile;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatch. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatch. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePropertiesPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DataBoxEdgeDevicePropertiesPatch(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._edgeProfile ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._edgeProfile.ToJson(null,serializationMode) : null, "edgeProfile" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceTags.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceTags.PowerShell.cs new file mode 100644 index 000000000000..b32266e36807 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceTags.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// The list of tags that describe the device. These tags can be used to view and group this device (across resource groups). + /// + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDeviceTagsTypeConverter))] + public partial class DataBoxEdgeDeviceTags + { + + /// + /// 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 DataBoxEdgeDeviceTags(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 DataBoxEdgeDeviceTags(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataBoxEdgeDeviceTags(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataBoxEdgeDeviceTags(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The list of tags that describe the device. These tags can be used to view and group this device (across resource groups). + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeDeviceTagsTypeConverter))] + public partial interface IDataBoxEdgeDeviceTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceTags.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceTags.TypeConverter.cs new file mode 100644 index 000000000000..4fa04654a388 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceTags.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataBoxEdgeDeviceTagsTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataBoxEdgeDeviceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataBoxEdgeDeviceTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataBoxEdgeDeviceTags.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/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceTags.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceTags.cs new file mode 100644 index 000000000000..880a9c50d2cd --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceTags.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// The list of tags that describe the device. These tags can be used to view and group this device (across resource groups). + /// + public partial class DataBoxEdgeDeviceTags : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTagsInternal + { + + /// Creates an new instance. + public DataBoxEdgeDeviceTags() + { + + } + } + /// The list of tags that describe the device. These tags can be used to view and group this device (across resource groups). + public partial interface IDataBoxEdgeDeviceTags : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray + { + + } + /// The list of tags that describe the device. These tags can be used to view and group this device (across resource groups). + internal partial interface IDataBoxEdgeDeviceTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceTags.dictionary.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceTags.dictionary.cs new file mode 100644 index 000000000000..24734398424b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceTags.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + public partial class DataBoxEdgeDeviceTags : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceTags.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceTags.json.cs new file mode 100644 index 000000000000..a35915738e47 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeDeviceTags.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// The list of tags that describe the device. These tags can be used to view and group this device (across resource groups). + /// + public partial class DataBoxEdgeDeviceTags + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + /// + internal DataBoxEdgeDeviceTags(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DataBoxEdgeDeviceTags(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeMoveRequest.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeMoveRequest.PowerShell.cs new file mode 100644 index 000000000000..84e39c9cdeff --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeMoveRequest.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Resource Move details + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeMoveRequestTypeConverter))] + public partial class DataBoxEdgeMoveRequest + { + + /// + /// 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 DataBoxEdgeMoveRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeMoveRequestInternal)this).TargetResourceGroup = (string) content.GetValueForProperty("TargetResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeMoveRequestInternal)this).TargetResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeMoveRequestInternal)this).Resource = (string[]) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeMoveRequestInternal)this).Resource, __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 DataBoxEdgeMoveRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeMoveRequestInternal)this).TargetResourceGroup = (string) content.GetValueForProperty("TargetResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeMoveRequestInternal)this).TargetResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeMoveRequestInternal)this).Resource = (string[]) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeMoveRequestInternal)this).Resource, __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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeMoveRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataBoxEdgeMoveRequest(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeMoveRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataBoxEdgeMoveRequest(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeMoveRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Resource Move details + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeMoveRequestTypeConverter))] + public partial interface IDataBoxEdgeMoveRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeMoveRequest.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeMoveRequest.TypeConverter.cs new file mode 100644 index 000000000000..710234bb2030 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeMoveRequest.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataBoxEdgeMoveRequestTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeMoveRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeMoveRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataBoxEdgeMoveRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataBoxEdgeMoveRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataBoxEdgeMoveRequest.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/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeMoveRequest.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeMoveRequest.cs new file mode 100644 index 000000000000..d7ac1394448a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeMoveRequest.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Resource Move details + public partial class DataBoxEdgeMoveRequest : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeMoveRequest, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeMoveRequestInternal + { + + /// Backing field for property. + private string[] _resource; + + /// List of resources to be moved + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string[] Resource { get => this._resource; set => this._resource = value; } + + /// Backing field for property. + private string _targetResourceGroup; + + /// Target resource group ARMId + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string TargetResourceGroup { get => this._targetResourceGroup; set => this._targetResourceGroup = value; } + + /// Creates an new instance. + public DataBoxEdgeMoveRequest() + { + + } + } + /// Resource Move details + public partial interface IDataBoxEdgeMoveRequest : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// List of resources to be moved + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"List of resources to be moved", + SerializedName = @"resources", + PossibleTypes = new [] { typeof(string) })] + string[] Resource { get; set; } + /// Target resource group ARMId + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Target resource group ARMId", + SerializedName = @"targetResourceGroup", + PossibleTypes = new [] { typeof(string) })] + string TargetResourceGroup { get; set; } + + } + /// Resource Move details + internal partial interface IDataBoxEdgeMoveRequestInternal + + { + /// List of resources to be moved + string[] Resource { get; set; } + /// Target resource group ARMId + string TargetResourceGroup { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeMoveRequest.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeMoveRequest.json.cs new file mode 100644 index 000000000000..931a77b8fc44 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeMoveRequest.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Resource Move details + public partial class DataBoxEdgeMoveRequest + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DataBoxEdgeMoveRequest(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_targetResourceGroup = If( json?.PropertyT("targetResourceGroup"), out var __jsonTargetResourceGroup) ? (string)__jsonTargetResourceGroup : (string)TargetResourceGroup;} + {_resource = If( json?.PropertyT("resources"), out var __jsonResources) ? If( __jsonResources as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Resource;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeMoveRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeMoveRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeMoveRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DataBoxEdgeMoveRequest(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._targetResourceGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._targetResourceGroup.ToString()) : null, "targetResourceGroup" ,container.Add ); + if (null != this._resource) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._resource ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("resources",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSku.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSku.PowerShell.cs new file mode 100644 index 000000000000..e82ad3fa1b53 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSku.PowerShell.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The Sku information. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeSkuTypeConverter))] + public partial class DataBoxEdgeSku + { + + /// + /// 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 DataBoxEdgeSku(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName?) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName.CreateFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Tier = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier?) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Tier, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier.CreateFrom); + } + if (content.Contains("Size")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Size = (string) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Size, global::System.Convert.ToString); + } + if (content.Contains("Family")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Family = (string) content.GetValueForProperty("Family",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Family, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Location = (string[]) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Location, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ApiVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).ApiVersion = (string[]) content.GetValueForProperty("ApiVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).ApiVersion, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("LocationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).LocationInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfo[]) content.GetValueForProperty("LocationInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).LocationInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SkuLocationInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("Cost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Cost = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCost[]) content.GetValueForProperty("Cost",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Cost, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SkuCostTypeConverter.ConvertFrom)); + } + if (content.Contains("SignupOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).SignupOption = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuSignupOption?) content.GetValueForProperty("SignupOption",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).SignupOption, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuSignupOption.CreateFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Version = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuVersion?) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Version, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuVersion.CreateFrom); + } + if (content.Contains("Availability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Availability = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuAvailability?) content.GetValueForProperty("Availability",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Availability, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuAvailability.CreateFrom); + } + if (content.Contains("ShipmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).ShipmentType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType[]) content.GetValueForProperty("ShipmentType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).ShipmentType, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType.CreateFrom)); + } + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Capability = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapability[]) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Capability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SkuCapabilityTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DataBoxEdgeSku(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName?) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName.CreateFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Tier = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier?) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Tier, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier.CreateFrom); + } + if (content.Contains("Size")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Size = (string) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Size, global::System.Convert.ToString); + } + if (content.Contains("Family")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Family = (string) content.GetValueForProperty("Family",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Family, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Location = (string[]) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Location, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ApiVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).ApiVersion = (string[]) content.GetValueForProperty("ApiVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).ApiVersion, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("LocationInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).LocationInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfo[]) content.GetValueForProperty("LocationInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).LocationInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SkuLocationInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("Cost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Cost = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCost[]) content.GetValueForProperty("Cost",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Cost, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SkuCostTypeConverter.ConvertFrom)); + } + if (content.Contains("SignupOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).SignupOption = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuSignupOption?) content.GetValueForProperty("SignupOption",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).SignupOption, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuSignupOption.CreateFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Version = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuVersion?) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Version, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuVersion.CreateFrom); + } + if (content.Contains("Availability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Availability = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuAvailability?) content.GetValueForProperty("Availability",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Availability, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuAvailability.CreateFrom); + } + if (content.Contains("ShipmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).ShipmentType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType[]) content.GetValueForProperty("ShipmentType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).ShipmentType, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType.CreateFrom)); + } + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Capability = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapability[]) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal)this).Capability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SkuCapabilityTypeConverter.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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataBoxEdgeSku(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataBoxEdgeSku(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Sku information. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeSkuTypeConverter))] + public partial interface IDataBoxEdgeSku + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSku.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSku.TypeConverter.cs new file mode 100644 index 000000000000..8365bca5fca4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSku.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataBoxEdgeSkuTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataBoxEdgeSku.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataBoxEdgeSku.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataBoxEdgeSku.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/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSku.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSku.cs new file mode 100644 index 000000000000..764888c18212 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSku.cs @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The Sku information. + public partial class DataBoxEdgeSku : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal + { + + /// Backing field for property. + private string[] _apiVersion; + + /// The API versions in which Sku is available. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string[] ApiVersion { get => this._apiVersion; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuAvailability? _availability; + + /// Links to the next set of results + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuAvailability? Availability { get => this._availability; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapability[] _capability; + + /// The capability info of the SKU. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapability[] Capability { get => this._capability; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCost[] _cost; + + /// The pricing info of the Sku. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCost[] Cost { get => this._cost; } + + /// Backing field for property. + private string _family; + + /// The Sku family. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Family { get => this._family; } + + /// Backing field for property. + private string _kind; + + /// The Sku kind. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Kind { get => this._kind; } + + /// Backing field for property. + private string[] _location; + + /// Availability of the Sku for the region. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string[] Location { get => this._location; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfo[] _locationInfo; + + /// Availability of the Sku for the location/zone/site. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfo[] LocationInfo { get => this._locationInfo; } + + /// Internal Acessors for ApiVersion + string[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal.ApiVersion { get => this._apiVersion; set { {_apiVersion = value;} } } + + /// Internal Acessors for Availability + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuAvailability? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal.Availability { get => this._availability; set { {_availability = value;} } } + + /// Internal Acessors for Capability + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapability[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal.Capability { get => this._capability; set { {_capability = value;} } } + + /// Internal Acessors for Cost + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCost[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal.Cost { get => this._cost; set { {_cost = value;} } } + + /// Internal Acessors for Family + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal.Family { get => this._family; set { {_family = value;} } } + + /// Internal Acessors for Kind + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal.Kind { get => this._kind; set { {_kind = value;} } } + + /// Internal Acessors for Location + string[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal.Location { get => this._location; set { {_location = value;} } } + + /// Internal Acessors for LocationInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal.LocationInfo { get => this._locationInfo; set { {_locationInfo = value;} } } + + /// Internal Acessors for Name + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for ResourceType + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal.ResourceType { get => this._resourceType; set { {_resourceType = value;} } } + + /// Internal Acessors for ShipmentType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal.ShipmentType { get => this._shipmentType; set { {_shipmentType = value;} } } + + /// Internal Acessors for SignupOption + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuSignupOption? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal.SignupOption { get => this._signupOption; set { {_signupOption = value;} } } + + /// Internal Acessors for Size + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal.Size { get => this._size; set { {_size = value;} } } + + /// Internal Acessors for Tier + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal.Tier { get => this._tier; set { {_tier = value;} } } + + /// Internal Acessors for Version + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuVersion? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuInternal.Version { get => this._version; set { {_version = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName? _name; + + /// The Sku name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName? Name { get => this._name; } + + /// Backing field for property. + private string _resourceType; + + /// The type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ResourceType { get => this._resourceType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType[] _shipmentType; + + /// List of Shipment Types supported by this SKU + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType[] ShipmentType { get => this._shipmentType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuSignupOption? _signupOption; + + /// Sku can be signed up by customer or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuSignupOption? SignupOption { get => this._signupOption; } + + /// Backing field for property. + private string _size; + + /// The Sku kind. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Size { get => this._size; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier? _tier; + + /// The Sku tier. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier? Tier { get => this._tier; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuVersion? _version; + + /// Availability of the Sku as preview/stable. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuVersion? Version { get => this._version; } + + /// Creates an new instance. + public DataBoxEdgeSku() + { + + } + } + /// The Sku information. + public partial interface IDataBoxEdgeSku : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The API versions in which Sku is available. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The API versions in which Sku is available.", + SerializedName = @"apiVersions", + PossibleTypes = new [] { typeof(string) })] + string[] ApiVersion { get; } + /// Links to the next set of results + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Links to the next set of results", + SerializedName = @"availability", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuAvailability) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuAvailability? Availability { get; } + /// The capability info of the SKU. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The capability info of the SKU.", + SerializedName = @"capabilities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapability) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapability[] Capability { get; } + /// The pricing info of the Sku. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The pricing info of the Sku.", + SerializedName = @"costs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCost) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCost[] Cost { get; } + /// The Sku family. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Sku family.", + SerializedName = @"family", + PossibleTypes = new [] { typeof(string) })] + string Family { get; } + /// The Sku kind. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Sku kind.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + string Kind { get; } + /// Availability of the Sku for the region. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Availability of the Sku for the region.", + SerializedName = @"locations", + PossibleTypes = new [] { typeof(string) })] + string[] Location { get; } + /// Availability of the Sku for the location/zone/site. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Availability of the Sku for the location/zone/site.", + SerializedName = @"locationInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfo[] LocationInfo { get; } + /// The Sku name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Sku name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName? Name { get; } + /// The type of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of the resource.", + SerializedName = @"resourceType", + PossibleTypes = new [] { typeof(string) })] + string ResourceType { get; } + /// List of Shipment Types supported by this SKU + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of Shipment Types supported by this SKU", + SerializedName = @"shipmentTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType[] ShipmentType { get; } + /// Sku can be signed up by customer or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Sku can be signed up by customer or not.", + SerializedName = @"signupOption", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuSignupOption) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuSignupOption? SignupOption { get; } + /// The Sku kind. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Sku kind.", + SerializedName = @"size", + PossibleTypes = new [] { typeof(string) })] + string Size { get; } + /// The Sku tier. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Sku tier.", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier? Tier { get; } + /// Availability of the Sku as preview/stable. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Availability of the Sku as preview/stable.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuVersion) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuVersion? Version { get; } + + } + /// The Sku information. + internal partial interface IDataBoxEdgeSkuInternal + + { + /// The API versions in which Sku is available. + string[] ApiVersion { get; set; } + /// Links to the next set of results + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuAvailability? Availability { get; set; } + /// The capability info of the SKU. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapability[] Capability { get; set; } + /// The pricing info of the Sku. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCost[] Cost { get; set; } + /// The Sku family. + string Family { get; set; } + /// The Sku kind. + string Kind { get; set; } + /// Availability of the Sku for the region. + string[] Location { get; set; } + /// Availability of the Sku for the location/zone/site. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfo[] LocationInfo { get; set; } + /// The Sku name. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName? Name { get; set; } + /// The type of the resource. + string ResourceType { get; set; } + /// List of Shipment Types supported by this SKU + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType[] ShipmentType { get; set; } + /// Sku can be signed up by customer or not. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuSignupOption? SignupOption { get; set; } + /// The Sku kind. + string Size { get; set; } + /// The Sku tier. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier? Tier { get; set; } + /// Availability of the Sku as preview/stable. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuVersion? Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSku.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSku.json.cs new file mode 100644 index 000000000000..aac6c1d6ff03 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSku.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The Sku information. + public partial class DataBoxEdgeSku + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DataBoxEdgeSku(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceType = If( json?.PropertyT("resourceType"), out var __jsonResourceType) ? (string)__jsonResourceType : (string)ResourceType;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + {_tier = If( json?.PropertyT("tier"), out var __jsonTier) ? (string)__jsonTier : (string)Tier;} + {_size = If( json?.PropertyT("size"), out var __jsonSize) ? (string)__jsonSize : (string)Size;} + {_family = If( json?.PropertyT("family"), out var __jsonFamily) ? (string)__jsonFamily : (string)Family;} + {_location = If( json?.PropertyT("locations"), out var __jsonLocations) ? If( __jsonLocations as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Location;} + {_apiVersion = If( json?.PropertyT("apiVersions"), out var __jsonApiVersions) ? If( __jsonApiVersions as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : ApiVersion;} + {_locationInfo = If( json?.PropertyT("locationInfo"), out var __jsonLocationInfo) ? If( __jsonLocationInfo as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfo) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SkuLocationInfo.FromJson(__k) )) ))() : null : LocationInfo;} + {_cost = If( json?.PropertyT("costs"), out var __jsonCosts) ? If( __jsonCosts as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCost) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SkuCost.FromJson(__f) )) ))() : null : Cost;} + {_signupOption = If( json?.PropertyT("signupOption"), out var __jsonSignupOption) ? (string)__jsonSignupOption : (string)SignupOption;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + {_availability = If( json?.PropertyT("availability"), out var __jsonAvailability) ? (string)__jsonAvailability : (string)Availability;} + {_shipmentType = If( json?.PropertyT("shipmentTypes"), out var __jsonShipmentTypes) ? If( __jsonShipmentTypes as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType) (__a is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString ___z ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType)(___z.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType)""))) ))() : null : ShipmentType;} + {_capability = If( json?.PropertyT("capabilities"), out var __jsonCapabilities) ? If( __jsonCapabilities as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonArray, out var ___w) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___w, (___v)=>(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapability) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SkuCapability.FromJson(___v) )) ))() : null : Capability;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DataBoxEdgeSku(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._resourceType.ToString()) : null, "resourceType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._tier.ToString()) : null, "tier" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._size)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._size.ToString()) : null, "size" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._family)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._family.ToString()) : null, "family" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._location) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._location ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("locations",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._apiVersion) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __s in this._apiVersion ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("apiVersions",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._locationInfo) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __n in this._locationInfo ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("locationInfo",__m); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._cost) + { + var __h = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __i in this._cost ) + { + AddIf(__i?.ToJson(null, serializationMode) ,__h.Add); + } + container.Add("costs",__h); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._signupOption)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._signupOption.ToString()) : null, "signupOption" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._availability)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._availability.ToString()) : null, "availability" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._shipmentType) + { + var __c = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __d in this._shipmentType ) + { + AddIf(null != (((object)__d)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(__d.ToString()) : null ,__c.Add); + } + container.Add("shipmentTypes",__c); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._capability) + { + var ___x = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var ___y in this._capability ) + { + AddIf(___y?.ToJson(null, serializationMode) ,___x.Add); + } + container.Add("capabilities",___x); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSkuList.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSkuList.PowerShell.cs new file mode 100644 index 000000000000..0db2ba3ffa73 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSkuList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// List of SKU Information objects. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeSkuListTypeConverter))] + public partial class DataBoxEdgeSkuList + { + + /// + /// 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 DataBoxEdgeSkuList(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeSkuTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuListInternal)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 DataBoxEdgeSkuList(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeSkuTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuListInternal)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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataBoxEdgeSkuList(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataBoxEdgeSkuList(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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// List of SKU Information objects. + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeSkuListTypeConverter))] + public partial interface IDataBoxEdgeSkuList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSkuList.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSkuList.TypeConverter.cs new file mode 100644 index 000000000000..2e3b806ac71d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSkuList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataBoxEdgeSkuListTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataBoxEdgeSkuList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataBoxEdgeSkuList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataBoxEdgeSkuList.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/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSkuList.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSkuList.cs new file mode 100644 index 000000000000..15ede9457a1f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSkuList.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// List of SKU Information objects. + public partial class DataBoxEdgeSkuList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuList, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuListInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Links to the next set of results + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku[] _value; + + /// List of ResourceType Sku + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku[] Value { get => this._value; } + + /// Creates an new instance. + public DataBoxEdgeSkuList() + { + + } + } + /// List of SKU Information objects. + public partial interface IDataBoxEdgeSkuList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Links to the next set of results + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Links to the next set of results", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// List of ResourceType Sku + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of ResourceType Sku", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku[] Value { get; } + + } + /// List of SKU Information objects. + internal partial interface IDataBoxEdgeSkuListInternal + + { + /// Links to the next set of results + string NextLink { get; set; } + /// List of ResourceType Sku + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSkuList.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSkuList.json.cs new file mode 100644 index 000000000000..cff97efac70e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataBoxEdgeSkuList.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// List of SKU Information objects. + public partial class DataBoxEdgeSkuList + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DataBoxEdgeSkuList(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeSku.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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSkuList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DataBoxEdgeSkuList(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/DataResidency.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataResidency.PowerShell.cs new file mode 100644 index 000000000000..5e9230276c27 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataResidency.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// Wraps data-residency related information for edge-resource and this should be used with ARM layer. + /// + [System.ComponentModel.TypeConverter(typeof(DataResidencyTypeConverter))] + public partial class DataResidency + { + + /// + /// 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 DataResidency(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.DataBoxEdge.Models.Api20220301.IDataResidencyInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidencyInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DataResidency(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.DataBoxEdge.Models.Api20220301.IDataResidencyInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidencyInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType.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.DataBoxEdge.Models.Api20220301.IDataResidency DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataResidency(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.DataBoxEdge.Models.Api20220301.IDataResidency DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataResidency(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.DataBoxEdge.Models.Api20220301.IDataResidency FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Wraps data-residency related information for edge-resource and this should be used with ARM layer. + [System.ComponentModel.TypeConverter(typeof(DataResidencyTypeConverter))] + public partial interface IDataResidency + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataResidency.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataResidency.TypeConverter.cs new file mode 100644 index 000000000000..ebf1cf02a576 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataResidency.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataResidencyTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDataResidency ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidency).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataResidency.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataResidency.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataResidency.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/databoxedge/generated/api/Models/Api20220301/DataResidency.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataResidency.cs new file mode 100644 index 000000000000..1f8d605addad --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataResidency.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// Wraps data-residency related information for edge-resource and this should be used with ARM layer. + /// + public partial class DataResidency : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidency, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidencyInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType? _type; + + /// DataResidencyType enum + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public DataResidency() + { + + } + } + /// Wraps data-residency related information for edge-resource and this should be used with ARM layer. + public partial interface IDataResidency : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// DataResidencyType enum + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DataResidencyType enum", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType? Type { get; set; } + + } + /// Wraps data-residency related information for edge-resource and this should be used with ARM layer. + internal partial interface IDataResidencyInternal + + { + /// DataResidencyType enum + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DataResidency.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataResidency.json.cs new file mode 100644 index 000000000000..178782d92e28 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DataResidency.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// Wraps data-residency related information for edge-resource and this should be used with ARM layer. + /// + public partial class DataResidency + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DataResidency(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidency. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidency. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataResidency FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DataResidency(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/DcAccessCode.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCode.PowerShell.cs new file mode 100644 index 000000000000..78a898ece4fe --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCode.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// DC Access code in the case of Self Managed Shipping. + [System.ComponentModel.TypeConverter(typeof(DcAccessCodeTypeConverter))] + public partial class DcAccessCode + { + + /// + /// 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 DcAccessCode(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.DataBoxEdge.Models.Api20220301.IDcAccessCodeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DcAccessCodePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AuthCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeInternal)this).AuthCode = (string) content.GetValueForProperty("AuthCode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeInternal)this).AuthCode, 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 DcAccessCode(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.DataBoxEdge.Models.Api20220301.IDcAccessCodeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DcAccessCodePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AuthCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeInternal)this).AuthCode = (string) content.GetValueForProperty("AuthCode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeInternal)this).AuthCode, 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.DataBoxEdge.Models.Api20220301.IDcAccessCode DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DcAccessCode(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.DataBoxEdge.Models.Api20220301.IDcAccessCode DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DcAccessCode(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.DataBoxEdge.Models.Api20220301.IDcAccessCode FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// DC Access code in the case of Self Managed Shipping. + [System.ComponentModel.TypeConverter(typeof(DcAccessCodeTypeConverter))] + public partial interface IDcAccessCode + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCode.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCode.TypeConverter.cs new file mode 100644 index 000000000000..e927b340d46f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCode.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DcAccessCodeTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDcAccessCode ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCode).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DcAccessCode.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DcAccessCode.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DcAccessCode.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/databoxedge/generated/api/Models/Api20220301/DcAccessCode.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCode.cs new file mode 100644 index 000000000000..d66bc6019ae9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCode.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// DC Access code in the case of Self Managed Shipping. + public partial class DcAccessCode : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCode, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeInternal + { + + /// DCAccess Code for the Self Managed shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string AuthCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodePropertiesInternal)Property).AuthCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodePropertiesInternal)Property).AuthCode = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DcAccessCodeProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties _property; + + /// DCAccessCode properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DcAccessCodeProperties()); set => this._property = value; } + + /// Creates an new instance. + public DcAccessCode() + { + + } + } + /// DC Access code in the case of Self Managed Shipping. + public partial interface IDcAccessCode : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// DCAccess Code for the Self Managed shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DCAccess Code for the Self Managed shipment.", + SerializedName = @"authCode", + PossibleTypes = new [] { typeof(string) })] + string AuthCode { get; set; } + + } + /// DC Access code in the case of Self Managed Shipping. + internal partial interface IDcAccessCodeInternal + + { + /// DCAccess Code for the Self Managed shipment. + string AuthCode { get; set; } + /// DCAccessCode properties. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCode.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCode.json.cs new file mode 100644 index 000000000000..4e848a7e050f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCode.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// DC Access code in the case of Self Managed Shipping. + public partial class DcAccessCode + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DcAccessCode(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.DcAccessCodeProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCode. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCode. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCode FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DcAccessCode(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/DcAccessCodeProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCodeProperties.PowerShell.cs new file mode 100644 index 000000000000..725110bfa0ec --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCodeProperties.PowerShell.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// DCAccessCode Properties. + [System.ComponentModel.TypeConverter(typeof(DcAccessCodePropertiesTypeConverter))] + public partial class DcAccessCodeProperties + { + + /// + /// 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 DcAccessCodeProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AuthCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodePropertiesInternal)this).AuthCode = (string) content.GetValueForProperty("AuthCode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodePropertiesInternal)this).AuthCode, 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 DcAccessCodeProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AuthCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodePropertiesInternal)this).AuthCode = (string) content.GetValueForProperty("AuthCode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodePropertiesInternal)this).AuthCode, 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.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DcAccessCodeProperties(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.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DcAccessCodeProperties(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.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// DCAccessCode Properties. + [System.ComponentModel.TypeConverter(typeof(DcAccessCodePropertiesTypeConverter))] + public partial interface IDcAccessCodeProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCodeProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCodeProperties.TypeConverter.cs new file mode 100644 index 000000000000..37b82f2facb9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCodeProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DcAccessCodePropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DcAccessCodeProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DcAccessCodeProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DcAccessCodeProperties.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/databoxedge/generated/api/Models/Api20220301/DcAccessCodeProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCodeProperties.cs new file mode 100644 index 000000000000..0cb79d32af4e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCodeProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// DCAccessCode Properties. + public partial class DcAccessCodeProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodePropertiesInternal + { + + /// Backing field for property. + private string _authCode; + + /// DCAccess Code for the Self Managed shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string AuthCode { get => this._authCode; set => this._authCode = value; } + + /// Creates an new instance. + public DcAccessCodeProperties() + { + + } + } + /// DCAccessCode Properties. + public partial interface IDcAccessCodeProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// DCAccess Code for the Self Managed shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DCAccess Code for the Self Managed shipment.", + SerializedName = @"authCode", + PossibleTypes = new [] { typeof(string) })] + string AuthCode { get; set; } + + } + /// DCAccessCode Properties. + internal partial interface IDcAccessCodePropertiesInternal + + { + /// DCAccess Code for the Self Managed shipment. + string AuthCode { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCodeProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCodeProperties.json.cs new file mode 100644 index 000000000000..d048c64d314a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DcAccessCodeProperties.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// DCAccessCode Properties. + public partial class DcAccessCodeProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DcAccessCodeProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_authCode = If( json?.PropertyT("authCode"), out var __jsonAuthCode) ? (string)__jsonAuthCode : (string)AuthCode;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DcAccessCodeProperties(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._authCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._authCode.ToString()) : null, "authCode" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfo.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfo.PowerShell.cs new file mode 100644 index 000000000000..ab8a3e5dfe75 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfo.PowerShell.cs @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Object for Capturing DeviceCapacityInfo + [System.ComponentModel.TypeConverter(typeof(DeviceCapacityInfoTypeConverter))] + public partial class DeviceCapacityInfo + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeviceCapacityInfo(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.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeviceCapacityInfo(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DeviceCapacityInfo(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.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityInfoPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ClusterStorageCapacityInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterStorageCapacityInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewData) content.GetValueForProperty("ClusterStorageCapacityInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterStorageCapacityInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterStorageViewDataTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterComputeCapacityInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewData) content.GetValueForProperty("ClusterComputeCapacityInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterCapacityViewDataTypeConverter.ConvertFrom); + } + if (content.Contains("TimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).TimeStamp = (global::System.DateTime?) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)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("NodeCapacityInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).NodeCapacityInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos) content.GetValueForProperty("NodeCapacityInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).NodeCapacityInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityInfoPropertiesNodeCapacityInfosTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ClusterStorageCapacityInfoClusterTotalStorageMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterStorageCapacityInfoClusterTotalStorageMb = (double?) content.GetValueForProperty("ClusterStorageCapacityInfoClusterTotalStorageMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterStorageCapacityInfoClusterTotalStorageMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterStorageCapacityInfoClusterFreeStorageMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterStorageCapacityInfoClusterFreeStorageMb = (double?) content.GetValueForProperty("ClusterStorageCapacityInfoClusterFreeStorageMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterStorageCapacityInfoClusterFreeStorageMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterComputeCapacityInfoGpuCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoGpuCapacity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity) content.GetValueForProperty("ClusterComputeCapacityInfoGpuCapacity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoGpuCapacity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterGpuCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterComputeCapacityInfoMemoryCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoMemoryCapacity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity) content.GetValueForProperty("ClusterComputeCapacityInfoMemoryCapacity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoMemoryCapacity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterMemoryCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterComputeCapacityInfoFqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoFqdn = (string) content.GetValueForProperty("ClusterComputeCapacityInfoFqdn",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoFqdn, global::System.Convert.ToString); + } + if (content.Contains("ClusterComputeCapacityInfoLastRefreshedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoLastRefreshedTime = (global::System.DateTime?) content.GetValueForProperty("ClusterComputeCapacityInfoLastRefreshedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoLastRefreshedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ClusterComputeCapacityInfoTotalProvisionedNonHpnCore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoTotalProvisionedNonHpnCore = (long?) content.GetValueForProperty("ClusterComputeCapacityInfoTotalProvisionedNonHpnCore",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoTotalProvisionedNonHpnCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("GpuCapacityGpuType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuType = (string) content.GetValueForProperty("GpuCapacityGpuType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuType, global::System.Convert.ToString); + } + if (content.Contains("GpuCapacityGpuUsedUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuUsedUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuUsedUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuUsedUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuCapacityGpuFreeUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuFreeUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuFreeUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuFreeUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuCapacityGpuReservedForFailoverUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuReservedForFailoverUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuReservedForFailoverUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuReservedForFailoverUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuCapacityGpuTotalUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuTotalUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuTotalUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuTotalUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MemoryCapacityClusterFreeMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterFreeMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterFreeMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterFreeMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterUsedMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterUsedMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterUsedMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterUsedMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterFailoverMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterFailoverMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterFailoverMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterFailoverMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterFragmentationMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterFragmentationMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterFragmentationMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterFragmentationMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterHypervReserveMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterHypervReserveMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterHypervReserveMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterHypervReserveMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterInfraVMMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterInfraVMMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterInfraVMMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterInfraVMMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterTotalMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterTotalMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterTotalMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterTotalMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterNonFailoverVMMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterNonFailoverVMMb = (double?) content.GetValueForProperty("MemoryCapacityClusterNonFailoverVMMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterNonFailoverVMMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterMemoryUsedByVmsMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterMemoryUsedByVmsMb = (double?) content.GetValueForProperty("MemoryCapacityClusterMemoryUsedByVmsMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterMemoryUsedByVmsMb, (__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 DeviceCapacityInfo(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.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityInfoPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ClusterStorageCapacityInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterStorageCapacityInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewData) content.GetValueForProperty("ClusterStorageCapacityInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterStorageCapacityInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterStorageViewDataTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterComputeCapacityInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewData) content.GetValueForProperty("ClusterComputeCapacityInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterCapacityViewDataTypeConverter.ConvertFrom); + } + if (content.Contains("TimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).TimeStamp = (global::System.DateTime?) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)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("NodeCapacityInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).NodeCapacityInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos) content.GetValueForProperty("NodeCapacityInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).NodeCapacityInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityInfoPropertiesNodeCapacityInfosTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ClusterStorageCapacityInfoClusterTotalStorageMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterStorageCapacityInfoClusterTotalStorageMb = (double?) content.GetValueForProperty("ClusterStorageCapacityInfoClusterTotalStorageMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterStorageCapacityInfoClusterTotalStorageMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterStorageCapacityInfoClusterFreeStorageMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterStorageCapacityInfoClusterFreeStorageMb = (double?) content.GetValueForProperty("ClusterStorageCapacityInfoClusterFreeStorageMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterStorageCapacityInfoClusterFreeStorageMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterComputeCapacityInfoGpuCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoGpuCapacity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity) content.GetValueForProperty("ClusterComputeCapacityInfoGpuCapacity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoGpuCapacity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterGpuCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterComputeCapacityInfoMemoryCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoMemoryCapacity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity) content.GetValueForProperty("ClusterComputeCapacityInfoMemoryCapacity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoMemoryCapacity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterMemoryCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterComputeCapacityInfoFqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoFqdn = (string) content.GetValueForProperty("ClusterComputeCapacityInfoFqdn",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoFqdn, global::System.Convert.ToString); + } + if (content.Contains("ClusterComputeCapacityInfoLastRefreshedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoLastRefreshedTime = (global::System.DateTime?) content.GetValueForProperty("ClusterComputeCapacityInfoLastRefreshedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoLastRefreshedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ClusterComputeCapacityInfoTotalProvisionedNonHpnCore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoTotalProvisionedNonHpnCore = (long?) content.GetValueForProperty("ClusterComputeCapacityInfoTotalProvisionedNonHpnCore",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).ClusterComputeCapacityInfoTotalProvisionedNonHpnCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("GpuCapacityGpuType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuType = (string) content.GetValueForProperty("GpuCapacityGpuType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuType, global::System.Convert.ToString); + } + if (content.Contains("GpuCapacityGpuUsedUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuUsedUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuUsedUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuUsedUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuCapacityGpuFreeUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuFreeUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuFreeUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuFreeUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuCapacityGpuReservedForFailoverUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuReservedForFailoverUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuReservedForFailoverUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuReservedForFailoverUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuCapacityGpuTotalUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuTotalUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuTotalUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).GpuCapacityGpuTotalUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MemoryCapacityClusterFreeMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterFreeMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterFreeMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterFreeMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterUsedMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterUsedMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterUsedMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterUsedMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterFailoverMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterFailoverMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterFailoverMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterFailoverMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterFragmentationMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterFragmentationMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterFragmentationMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterFragmentationMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterHypervReserveMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterHypervReserveMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterHypervReserveMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterHypervReserveMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterInfraVMMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterInfraVMMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterInfraVMMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterInfraVMMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterTotalMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterTotalMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterTotalMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterTotalMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterNonFailoverVMMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterNonFailoverVMMb = (double?) content.GetValueForProperty("MemoryCapacityClusterNonFailoverVMMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterNonFailoverVMMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterMemoryUsedByVmsMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterMemoryUsedByVmsMb = (double?) content.GetValueForProperty("MemoryCapacityClusterMemoryUsedByVmsMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal)this).MemoryCapacityClusterMemoryUsedByVmsMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + 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.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Object for Capturing DeviceCapacityInfo + [System.ComponentModel.TypeConverter(typeof(DeviceCapacityInfoTypeConverter))] + public partial interface IDeviceCapacityInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfo.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfo.TypeConverter.cs new file mode 100644 index 000000000000..709d8e3fd487 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DeviceCapacityInfoTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DeviceCapacityInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DeviceCapacityInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DeviceCapacityInfo.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/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfo.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfo.cs new file mode 100644 index 000000000000..d7690a935e3e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfo.cs @@ -0,0 +1,496 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Object for Capturing DeviceCapacityInfo + public partial class DeviceCapacityInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// The FQDN of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ClusterComputeCapacityInfoFqdn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).ClusterComputeCapacityInfoFqdn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).ClusterComputeCapacityInfoFqdn = value ?? null; } + + /// The last time at which the ClusterCapacityViewData was set. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? ClusterComputeCapacityInfoLastRefreshedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).ClusterComputeCapacityInfoLastRefreshedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).ClusterComputeCapacityInfoLastRefreshedTime = value ?? default(global::System.DateTime); } + + /// The total # of vCPUs provisioned by non-HPN VM per appliance. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public long? ClusterComputeCapacityInfoTotalProvisionedNonHpnCore { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).ClusterComputeCapacityInfoTotalProvisionedNonHpnCore; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).ClusterComputeCapacityInfoTotalProvisionedNonHpnCore = value ?? default(long); } + + /// The available or free storage on the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? ClusterStorageCapacityInfoClusterFreeStorageMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).ClusterStorageCapacityInfoClusterFreeStorageMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).ClusterStorageCapacityInfoClusterFreeStorageMb = value ?? default(double); } + + /// Total storage on the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? ClusterStorageCapacityInfoClusterTotalStorageMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).ClusterStorageCapacityInfoClusterTotalStorageMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).ClusterStorageCapacityInfoClusterTotalStorageMb = value ?? default(double); } + + /// The free GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? GpuCapacityGpuFreeUnitsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).GpuCapacityGpuFreeUnitsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).GpuCapacityGpuFreeUnitsCount = value ?? default(int); } + + /// The GPU units count reserved for failover in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? GpuCapacityGpuReservedForFailoverUnitsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).GpuCapacityGpuReservedForFailoverUnitsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).GpuCapacityGpuReservedForFailoverUnitsCount = value ?? default(int); } + + /// The total GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? GpuCapacityGpuTotalUnitsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).GpuCapacityGpuTotalUnitsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).GpuCapacityGpuTotalUnitsCount = value ?? default(int); } + + /// The cluster GPU Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string GpuCapacityGpuType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).GpuCapacityGpuType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).GpuCapacityGpuType = value ?? null; } + + /// The used GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? GpuCapacityGpuUsedUnitsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).GpuCapacityGpuUsedUnitsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).GpuCapacityGpuUsedUnitsCount = value ?? default(int); } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// The failover memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterFailoverMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).MemoryCapacityClusterFailoverMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).MemoryCapacityClusterFailoverMemoryMb = value ?? default(double); } + + /// The fragmentation memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterFragmentationMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).MemoryCapacityClusterFragmentationMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).MemoryCapacityClusterFragmentationMemoryMb = value ?? default(double); } + + /// The free memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterFreeMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).MemoryCapacityClusterFreeMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).MemoryCapacityClusterFreeMemoryMb = value ?? default(double); } + + /// The memory reserved for Hyper-V in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterHypervReserveMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).MemoryCapacityClusterHypervReserveMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).MemoryCapacityClusterHypervReserveMemoryMb = value ?? default(double); } + + /// The memory of the Infra VM in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterInfraVMMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).MemoryCapacityClusterInfraVMMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).MemoryCapacityClusterInfraVMMemoryMb = value ?? default(double); } + + /// The memory used by VMs in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterMemoryUsedByVmsMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).MemoryCapacityClusterMemoryUsedByVmsMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).MemoryCapacityClusterMemoryUsedByVmsMb = value ?? default(double); } + + /// The non-failover memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterNonFailoverVMMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).MemoryCapacityClusterNonFailoverVMMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).MemoryCapacityClusterNonFailoverVMMb = value ?? default(double); } + + /// The total memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterTotalMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).MemoryCapacityClusterTotalMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).MemoryCapacityClusterTotalMemoryMb = value ?? default(double); } + + /// The used memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterUsedMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).MemoryCapacityClusterUsedMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).MemoryCapacityClusterUsedMemoryMb = value ?? default(double); } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for ClusterComputeCapacityInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal.ClusterComputeCapacityInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).ClusterComputeCapacityInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).ClusterComputeCapacityInfo = value; } + + /// Internal Acessors for ClusterComputeCapacityInfoGpuCapacity + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal.ClusterComputeCapacityInfoGpuCapacity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).ClusterComputeCapacityInfoGpuCapacity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).ClusterComputeCapacityInfoGpuCapacity = value; } + + /// Internal Acessors for ClusterComputeCapacityInfoMemoryCapacity + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal.ClusterComputeCapacityInfoMemoryCapacity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).ClusterComputeCapacityInfoMemoryCapacity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).ClusterComputeCapacityInfoMemoryCapacity = value; } + + /// Internal Acessors for ClusterStorageCapacityInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal.ClusterStorageCapacityInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).ClusterStorageCapacityInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).ClusterStorageCapacityInfo = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityInfoProperties()); set { {_property = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// The dictionary of individual node names and node capacities in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos NodeCapacityInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).NodeCapacityInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).NodeCapacityInfo = value ?? null /* model class */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoProperties _property; + + /// The device capacity properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityInfoProperties()); set => this._property = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// Metadata pertaining to device capacity info. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// Timestamp of request in UTC + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? TimeStamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).TimeStamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)Property).TimeStamp = value ?? default(global::System.DateTime); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Creates an new instance. + public DeviceCapacityInfo() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// Object for Capturing DeviceCapacityInfo + public partial interface IDeviceCapacityInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// The FQDN of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The FQDN of the cluster.", + SerializedName = @"fqdn", + PossibleTypes = new [] { typeof(string) })] + string ClusterComputeCapacityInfoFqdn { get; set; } + /// The last time at which the ClusterCapacityViewData was set. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The last time at which the ClusterCapacityViewData was set.", + SerializedName = @"lastRefreshedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ClusterComputeCapacityInfoLastRefreshedTime { get; set; } + /// The total # of vCPUs provisioned by non-HPN VM per appliance. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total # of vCPUs provisioned by non-HPN VM per appliance.", + SerializedName = @"totalProvisionedNonHpnCores", + PossibleTypes = new [] { typeof(long) })] + long? ClusterComputeCapacityInfoTotalProvisionedNonHpnCore { get; set; } + /// The available or free storage on the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The available or free storage on the cluster in MB.", + SerializedName = @"clusterFreeStorageMb", + PossibleTypes = new [] { typeof(double) })] + double? ClusterStorageCapacityInfoClusterFreeStorageMb { get; set; } + /// Total storage on the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total storage on the cluster in MB.", + SerializedName = @"clusterTotalStorageMb", + PossibleTypes = new [] { typeof(double) })] + double? ClusterStorageCapacityInfoClusterTotalStorageMb { get; set; } + /// The free GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The free GPU units count in the cluster.", + SerializedName = @"gpuFreeUnitsCount", + PossibleTypes = new [] { typeof(int) })] + int? GpuCapacityGpuFreeUnitsCount { get; set; } + /// The GPU units count reserved for failover in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The GPU units count reserved for failover in the cluster.", + SerializedName = @"gpuReservedForFailoverUnitsCount", + PossibleTypes = new [] { typeof(int) })] + int? GpuCapacityGpuReservedForFailoverUnitsCount { get; set; } + /// The total GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total GPU units count in the cluster.", + SerializedName = @"gpuTotalUnitsCount", + PossibleTypes = new [] { typeof(int) })] + int? GpuCapacityGpuTotalUnitsCount { get; set; } + /// The cluster GPU Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The cluster GPU Type.", + SerializedName = @"gpuType", + PossibleTypes = new [] { typeof(string) })] + string GpuCapacityGpuType { get; set; } + /// The used GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The used GPU units count in the cluster.", + SerializedName = @"gpuUsedUnitsCount", + PossibleTypes = new [] { typeof(int) })] + int? GpuCapacityGpuUsedUnitsCount { get; set; } + /// The failover memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The failover memory in the cluster in MB.", + SerializedName = @"clusterFailoverMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterFailoverMemoryMb { get; set; } + /// The fragmentation memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The fragmentation memory in the cluster in MB.", + SerializedName = @"clusterFragmentationMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterFragmentationMemoryMb { get; set; } + /// The free memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The free memory in the cluster in MB.", + SerializedName = @"clusterFreeMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterFreeMemoryMb { get; set; } + /// The memory reserved for Hyper-V in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The memory reserved for Hyper-V in the cluster in MB.", + SerializedName = @"clusterHypervReserveMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterHypervReserveMemoryMb { get; set; } + /// The memory of the Infra VM in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The memory of the Infra VM in the cluster in MB.", + SerializedName = @"clusterInfraVmMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterInfraVMMemoryMb { get; set; } + /// The memory used by VMs in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The memory used by VMs in the cluster in MB.", + SerializedName = @"clusterMemoryUsedByVmsMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterMemoryUsedByVmsMb { get; set; } + /// The non-failover memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The non-failover memory in the cluster in MB.", + SerializedName = @"clusterNonFailoverVmMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterNonFailoverVMMb { get; set; } + /// The total memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total memory in the cluster in MB.", + SerializedName = @"clusterTotalMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterTotalMemoryMb { get; set; } + /// The used memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The used memory in the cluster in MB.", + SerializedName = @"clusterUsedMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterUsedMemoryMb { get; set; } + /// The dictionary of individual node names and node capacities in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The dictionary of individual node names and node capacities in the cluster.", + SerializedName = @"nodeCapacityInfos", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos NodeCapacityInfo { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Timestamp of request in UTC + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Timestamp of request in UTC", + SerializedName = @"timeStamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimeStamp { get; set; } + + } + /// Object for Capturing DeviceCapacityInfo + internal partial interface IDeviceCapacityInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// Cluster capacity data for compute resources (Memory and GPU). + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewData ClusterComputeCapacityInfo { get; set; } + /// The FQDN of the cluster. + string ClusterComputeCapacityInfoFqdn { get; set; } + /// The cluster's GPU capacity. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity ClusterComputeCapacityInfoGpuCapacity { get; set; } + /// The last time at which the ClusterCapacityViewData was set. + global::System.DateTime? ClusterComputeCapacityInfoLastRefreshedTime { get; set; } + /// The cluster's memory capacity. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity ClusterComputeCapacityInfoMemoryCapacity { get; set; } + /// The total # of vCPUs provisioned by non-HPN VM per appliance. + long? ClusterComputeCapacityInfoTotalProvisionedNonHpnCore { get; set; } + /// Cluster capacity data for storage resources (CSV). + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewData ClusterStorageCapacityInfo { get; set; } + /// The available or free storage on the cluster in MB. + double? ClusterStorageCapacityInfoClusterFreeStorageMb { get; set; } + /// Total storage on the cluster in MB. + double? ClusterStorageCapacityInfoClusterTotalStorageMb { get; set; } + /// The free GPU units count in the cluster. + int? GpuCapacityGpuFreeUnitsCount { get; set; } + /// The GPU units count reserved for failover in the cluster. + int? GpuCapacityGpuReservedForFailoverUnitsCount { get; set; } + /// The total GPU units count in the cluster. + int? GpuCapacityGpuTotalUnitsCount { get; set; } + /// The cluster GPU Type. + string GpuCapacityGpuType { get; set; } + /// The used GPU units count in the cluster. + int? GpuCapacityGpuUsedUnitsCount { get; set; } + /// The failover memory in the cluster in MB. + double? MemoryCapacityClusterFailoverMemoryMb { get; set; } + /// The fragmentation memory in the cluster in MB. + double? MemoryCapacityClusterFragmentationMemoryMb { get; set; } + /// The free memory in the cluster in MB. + double? MemoryCapacityClusterFreeMemoryMb { get; set; } + /// The memory reserved for Hyper-V in the cluster in MB. + double? MemoryCapacityClusterHypervReserveMemoryMb { get; set; } + /// The memory of the Infra VM in the cluster in MB. + double? MemoryCapacityClusterInfraVMMemoryMb { get; set; } + /// The memory used by VMs in the cluster in MB. + double? MemoryCapacityClusterMemoryUsedByVmsMb { get; set; } + /// The non-failover memory in the cluster in MB. + double? MemoryCapacityClusterNonFailoverVMMb { get; set; } + /// The total memory in the cluster in MB. + double? MemoryCapacityClusterTotalMemoryMb { get; set; } + /// The used memory in the cluster in MB. + double? MemoryCapacityClusterUsedMemoryMb { get; set; } + /// The dictionary of individual node names and node capacities in the cluster. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos NodeCapacityInfo { get; set; } + /// The device capacity properties. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoProperties Property { get; set; } + /// Metadata pertaining to device capacity info. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Timestamp of request in UTC + global::System.DateTime? TimeStamp { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfo.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfo.json.cs new file mode 100644 index 000000000000..74485999d976 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfo.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Object for Capturing DeviceCapacityInfo + public partial class DeviceCapacityInfo + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DeviceCapacityInfo(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityInfoProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DeviceCapacityInfo(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoProperties.PowerShell.cs new file mode 100644 index 000000000000..322c17441b8e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The properties of Device Capacity Info + [System.ComponentModel.TypeConverter(typeof(DeviceCapacityInfoPropertiesTypeConverter))] + public partial class DeviceCapacityInfoProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeviceCapacityInfoProperties(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.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeviceCapacityInfoProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DeviceCapacityInfoProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ClusterStorageCapacityInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterStorageCapacityInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewData) content.GetValueForProperty("ClusterStorageCapacityInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterStorageCapacityInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterStorageViewDataTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterComputeCapacityInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewData) content.GetValueForProperty("ClusterComputeCapacityInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterCapacityViewDataTypeConverter.ConvertFrom); + } + if (content.Contains("TimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).TimeStamp = (global::System.DateTime?) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)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("NodeCapacityInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).NodeCapacityInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos) content.GetValueForProperty("NodeCapacityInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).NodeCapacityInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityInfoPropertiesNodeCapacityInfosTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterStorageCapacityInfoClusterTotalStorageMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterStorageCapacityInfoClusterTotalStorageMb = (double?) content.GetValueForProperty("ClusterStorageCapacityInfoClusterTotalStorageMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterStorageCapacityInfoClusterTotalStorageMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterStorageCapacityInfoClusterFreeStorageMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterStorageCapacityInfoClusterFreeStorageMb = (double?) content.GetValueForProperty("ClusterStorageCapacityInfoClusterFreeStorageMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterStorageCapacityInfoClusterFreeStorageMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterComputeCapacityInfoGpuCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoGpuCapacity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity) content.GetValueForProperty("ClusterComputeCapacityInfoGpuCapacity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoGpuCapacity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterGpuCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterComputeCapacityInfoMemoryCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoMemoryCapacity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity) content.GetValueForProperty("ClusterComputeCapacityInfoMemoryCapacity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoMemoryCapacity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterMemoryCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterComputeCapacityInfoFqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoFqdn = (string) content.GetValueForProperty("ClusterComputeCapacityInfoFqdn",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoFqdn, global::System.Convert.ToString); + } + if (content.Contains("ClusterComputeCapacityInfoLastRefreshedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoLastRefreshedTime = (global::System.DateTime?) content.GetValueForProperty("ClusterComputeCapacityInfoLastRefreshedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoLastRefreshedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ClusterComputeCapacityInfoTotalProvisionedNonHpnCore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoTotalProvisionedNonHpnCore = (long?) content.GetValueForProperty("ClusterComputeCapacityInfoTotalProvisionedNonHpnCore",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoTotalProvisionedNonHpnCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("GpuCapacityGpuType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuType = (string) content.GetValueForProperty("GpuCapacityGpuType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuType, global::System.Convert.ToString); + } + if (content.Contains("GpuCapacityGpuUsedUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuUsedUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuUsedUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuUsedUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuCapacityGpuFreeUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuFreeUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuFreeUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuFreeUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuCapacityGpuReservedForFailoverUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuReservedForFailoverUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuReservedForFailoverUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuReservedForFailoverUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuCapacityGpuTotalUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuTotalUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuTotalUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuTotalUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MemoryCapacityClusterFreeMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterFreeMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterFreeMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterFreeMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterUsedMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterUsedMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterUsedMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterUsedMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterFailoverMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterFailoverMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterFailoverMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterFailoverMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterFragmentationMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterFragmentationMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterFragmentationMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterFragmentationMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterHypervReserveMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterHypervReserveMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterHypervReserveMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterHypervReserveMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterInfraVMMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterInfraVMMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterInfraVMMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterInfraVMMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterTotalMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterTotalMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterTotalMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterTotalMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterNonFailoverVMMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterNonFailoverVMMb = (double?) content.GetValueForProperty("MemoryCapacityClusterNonFailoverVMMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterNonFailoverVMMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterMemoryUsedByVmsMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterMemoryUsedByVmsMb = (double?) content.GetValueForProperty("MemoryCapacityClusterMemoryUsedByVmsMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterMemoryUsedByVmsMb, (__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 DeviceCapacityInfoProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ClusterStorageCapacityInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterStorageCapacityInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewData) content.GetValueForProperty("ClusterStorageCapacityInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterStorageCapacityInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterStorageViewDataTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterComputeCapacityInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewData) content.GetValueForProperty("ClusterComputeCapacityInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterCapacityViewDataTypeConverter.ConvertFrom); + } + if (content.Contains("TimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).TimeStamp = (global::System.DateTime?) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)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("NodeCapacityInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).NodeCapacityInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos) content.GetValueForProperty("NodeCapacityInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).NodeCapacityInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityInfoPropertiesNodeCapacityInfosTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterStorageCapacityInfoClusterTotalStorageMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterStorageCapacityInfoClusterTotalStorageMb = (double?) content.GetValueForProperty("ClusterStorageCapacityInfoClusterTotalStorageMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterStorageCapacityInfoClusterTotalStorageMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterStorageCapacityInfoClusterFreeStorageMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterStorageCapacityInfoClusterFreeStorageMb = (double?) content.GetValueForProperty("ClusterStorageCapacityInfoClusterFreeStorageMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterStorageCapacityInfoClusterFreeStorageMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("ClusterComputeCapacityInfoGpuCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoGpuCapacity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity) content.GetValueForProperty("ClusterComputeCapacityInfoGpuCapacity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoGpuCapacity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterGpuCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterComputeCapacityInfoMemoryCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoMemoryCapacity = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity) content.GetValueForProperty("ClusterComputeCapacityInfoMemoryCapacity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoMemoryCapacity, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterMemoryCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterComputeCapacityInfoFqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoFqdn = (string) content.GetValueForProperty("ClusterComputeCapacityInfoFqdn",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoFqdn, global::System.Convert.ToString); + } + if (content.Contains("ClusterComputeCapacityInfoLastRefreshedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoLastRefreshedTime = (global::System.DateTime?) content.GetValueForProperty("ClusterComputeCapacityInfoLastRefreshedTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoLastRefreshedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ClusterComputeCapacityInfoTotalProvisionedNonHpnCore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoTotalProvisionedNonHpnCore = (long?) content.GetValueForProperty("ClusterComputeCapacityInfoTotalProvisionedNonHpnCore",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).ClusterComputeCapacityInfoTotalProvisionedNonHpnCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("GpuCapacityGpuType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuType = (string) content.GetValueForProperty("GpuCapacityGpuType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuType, global::System.Convert.ToString); + } + if (content.Contains("GpuCapacityGpuUsedUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuUsedUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuUsedUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuUsedUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuCapacityGpuFreeUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuFreeUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuFreeUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuFreeUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuCapacityGpuReservedForFailoverUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuReservedForFailoverUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuReservedForFailoverUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuReservedForFailoverUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("GpuCapacityGpuTotalUnitsCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuTotalUnitsCount = (int?) content.GetValueForProperty("GpuCapacityGpuTotalUnitsCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).GpuCapacityGpuTotalUnitsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MemoryCapacityClusterFreeMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterFreeMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterFreeMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterFreeMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterUsedMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterUsedMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterUsedMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterUsedMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterFailoverMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterFailoverMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterFailoverMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterFailoverMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterFragmentationMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterFragmentationMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterFragmentationMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterFragmentationMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterHypervReserveMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterHypervReserveMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterHypervReserveMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterHypervReserveMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterInfraVMMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterInfraVMMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterInfraVMMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterInfraVMMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterTotalMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterTotalMemoryMb = (double?) content.GetValueForProperty("MemoryCapacityClusterTotalMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterTotalMemoryMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterNonFailoverVMMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterNonFailoverVMMb = (double?) content.GetValueForProperty("MemoryCapacityClusterNonFailoverVMMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterNonFailoverVMMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MemoryCapacityClusterMemoryUsedByVmsMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterMemoryUsedByVmsMb = (double?) content.GetValueForProperty("MemoryCapacityClusterMemoryUsedByVmsMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal)this).MemoryCapacityClusterMemoryUsedByVmsMb, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + 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.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of Device Capacity Info + [System.ComponentModel.TypeConverter(typeof(DeviceCapacityInfoPropertiesTypeConverter))] + public partial interface IDeviceCapacityInfoProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoProperties.TypeConverter.cs new file mode 100644 index 000000000000..6fa44d89c17b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DeviceCapacityInfoPropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DeviceCapacityInfoProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DeviceCapacityInfoProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DeviceCapacityInfoProperties.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/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoProperties.cs new file mode 100644 index 000000000000..1aea1199534d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The properties of Device Capacity Info + public partial class DeviceCapacityInfoProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewData _clusterComputeCapacityInfo; + + /// Cluster capacity data for compute resources (Memory and GPU). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewData ClusterComputeCapacityInfo { get => (this._clusterComputeCapacityInfo = this._clusterComputeCapacityInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterCapacityViewData()); set => this._clusterComputeCapacityInfo = value; } + + /// The FQDN of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ClusterComputeCapacityInfoFqdn { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).Fqdn; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).Fqdn = value ?? null; } + + /// The last time at which the ClusterCapacityViewData was set. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? ClusterComputeCapacityInfoLastRefreshedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).LastRefreshedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).LastRefreshedTime = value ?? default(global::System.DateTime); } + + /// The total # of vCPUs provisioned by non-HPN VM per appliance. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public long? ClusterComputeCapacityInfoTotalProvisionedNonHpnCore { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).TotalProvisionedNonHpnCore; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).TotalProvisionedNonHpnCore = value ?? default(long); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewData _clusterStorageCapacityInfo; + + /// Cluster capacity data for storage resources (CSV). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewData ClusterStorageCapacityInfo { get => (this._clusterStorageCapacityInfo = this._clusterStorageCapacityInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterStorageViewData()); set => this._clusterStorageCapacityInfo = value; } + + /// The available or free storage on the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? ClusterStorageCapacityInfoClusterFreeStorageMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewDataInternal)ClusterStorageCapacityInfo).ClusterFreeStorageMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewDataInternal)ClusterStorageCapacityInfo).ClusterFreeStorageMb = value ?? default(double); } + + /// Total storage on the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? ClusterStorageCapacityInfoClusterTotalStorageMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewDataInternal)ClusterStorageCapacityInfo).ClusterTotalStorageMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewDataInternal)ClusterStorageCapacityInfo).ClusterTotalStorageMb = value ?? default(double); } + + /// The free GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? GpuCapacityGpuFreeUnitsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).GpuCapacityGpuFreeUnitsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).GpuCapacityGpuFreeUnitsCount = value ?? default(int); } + + /// The GPU units count reserved for failover in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? GpuCapacityGpuReservedForFailoverUnitsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).GpuCapacityGpuReservedForFailoverUnitsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).GpuCapacityGpuReservedForFailoverUnitsCount = value ?? default(int); } + + /// The total GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? GpuCapacityGpuTotalUnitsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).GpuCapacityGpuTotalUnitsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).GpuCapacityGpuTotalUnitsCount = value ?? default(int); } + + /// The cluster GPU Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string GpuCapacityGpuType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).GpuCapacityGpuType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).GpuCapacityGpuType = value ?? null; } + + /// The used GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? GpuCapacityGpuUsedUnitsCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).GpuCapacityGpuUsedUnitsCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).GpuCapacityGpuUsedUnitsCount = value ?? default(int); } + + /// The failover memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterFailoverMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacityClusterFailoverMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacityClusterFailoverMemoryMb = value ?? default(double); } + + /// The fragmentation memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterFragmentationMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacityClusterFragmentationMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacityClusterFragmentationMemoryMb = value ?? default(double); } + + /// The free memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterFreeMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacityClusterFreeMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacityClusterFreeMemoryMb = value ?? default(double); } + + /// The memory reserved for Hyper-V in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterHypervReserveMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacityClusterHypervReserveMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacityClusterHypervReserveMemoryMb = value ?? default(double); } + + /// The memory of the Infra VM in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterInfraVMMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacityClusterInfraVMMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacityClusterInfraVMMemoryMb = value ?? default(double); } + + /// The memory used by VMs in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterMemoryUsedByVmsMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacityClusterMemoryUsedByVmsMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacityClusterMemoryUsedByVmsMb = value ?? default(double); } + + /// The non-failover memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterNonFailoverVMMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacityClusterNonFailoverVMMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacityClusterNonFailoverVMMb = value ?? default(double); } + + /// The total memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterTotalMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacityClusterTotalMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacityClusterTotalMemoryMb = value ?? default(double); } + + /// The used memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? MemoryCapacityClusterUsedMemoryMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacityClusterUsedMemoryMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacityClusterUsedMemoryMb = value ?? default(double); } + + /// Internal Acessors for ClusterComputeCapacityInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal.ClusterComputeCapacityInfo { get => (this._clusterComputeCapacityInfo = this._clusterComputeCapacityInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterCapacityViewData()); set { {_clusterComputeCapacityInfo = value;} } } + + /// Internal Acessors for ClusterComputeCapacityInfoGpuCapacity + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal.ClusterComputeCapacityInfoGpuCapacity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).GpuCapacity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).GpuCapacity = value; } + + /// Internal Acessors for ClusterComputeCapacityInfoMemoryCapacity + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal.ClusterComputeCapacityInfoMemoryCapacity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewDataInternal)ClusterComputeCapacityInfo).MemoryCapacity = value; } + + /// Internal Acessors for ClusterStorageCapacityInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesInternal.ClusterStorageCapacityInfo { get => (this._clusterStorageCapacityInfo = this._clusterStorageCapacityInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterStorageViewData()); set { {_clusterStorageCapacityInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos _nodeCapacityInfo; + + /// The dictionary of individual node names and node capacities in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos NodeCapacityInfo { get => (this._nodeCapacityInfo = this._nodeCapacityInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityInfoPropertiesNodeCapacityInfos()); set => this._nodeCapacityInfo = value; } + + /// Backing field for property. + private global::System.DateTime? _timeStamp; + + /// Timestamp of request in UTC + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? TimeStamp { get => this._timeStamp; set => this._timeStamp = value; } + + /// Creates an new instance. + public DeviceCapacityInfoProperties() + { + + } + } + /// The properties of Device Capacity Info + public partial interface IDeviceCapacityInfoProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The FQDN of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The FQDN of the cluster.", + SerializedName = @"fqdn", + PossibleTypes = new [] { typeof(string) })] + string ClusterComputeCapacityInfoFqdn { get; set; } + /// The last time at which the ClusterCapacityViewData was set. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The last time at which the ClusterCapacityViewData was set.", + SerializedName = @"lastRefreshedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ClusterComputeCapacityInfoLastRefreshedTime { get; set; } + /// The total # of vCPUs provisioned by non-HPN VM per appliance. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total # of vCPUs provisioned by non-HPN VM per appliance.", + SerializedName = @"totalProvisionedNonHpnCores", + PossibleTypes = new [] { typeof(long) })] + long? ClusterComputeCapacityInfoTotalProvisionedNonHpnCore { get; set; } + /// The available or free storage on the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The available or free storage on the cluster in MB.", + SerializedName = @"clusterFreeStorageMb", + PossibleTypes = new [] { typeof(double) })] + double? ClusterStorageCapacityInfoClusterFreeStorageMb { get; set; } + /// Total storage on the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total storage on the cluster in MB.", + SerializedName = @"clusterTotalStorageMb", + PossibleTypes = new [] { typeof(double) })] + double? ClusterStorageCapacityInfoClusterTotalStorageMb { get; set; } + /// The free GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The free GPU units count in the cluster.", + SerializedName = @"gpuFreeUnitsCount", + PossibleTypes = new [] { typeof(int) })] + int? GpuCapacityGpuFreeUnitsCount { get; set; } + /// The GPU units count reserved for failover in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The GPU units count reserved for failover in the cluster.", + SerializedName = @"gpuReservedForFailoverUnitsCount", + PossibleTypes = new [] { typeof(int) })] + int? GpuCapacityGpuReservedForFailoverUnitsCount { get; set; } + /// The total GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total GPU units count in the cluster.", + SerializedName = @"gpuTotalUnitsCount", + PossibleTypes = new [] { typeof(int) })] + int? GpuCapacityGpuTotalUnitsCount { get; set; } + /// The cluster GPU Type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The cluster GPU Type.", + SerializedName = @"gpuType", + PossibleTypes = new [] { typeof(string) })] + string GpuCapacityGpuType { get; set; } + /// The used GPU units count in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The used GPU units count in the cluster.", + SerializedName = @"gpuUsedUnitsCount", + PossibleTypes = new [] { typeof(int) })] + int? GpuCapacityGpuUsedUnitsCount { get; set; } + /// The failover memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The failover memory in the cluster in MB.", + SerializedName = @"clusterFailoverMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterFailoverMemoryMb { get; set; } + /// The fragmentation memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The fragmentation memory in the cluster in MB.", + SerializedName = @"clusterFragmentationMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterFragmentationMemoryMb { get; set; } + /// The free memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The free memory in the cluster in MB.", + SerializedName = @"clusterFreeMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterFreeMemoryMb { get; set; } + /// The memory reserved for Hyper-V in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The memory reserved for Hyper-V in the cluster in MB.", + SerializedName = @"clusterHypervReserveMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterHypervReserveMemoryMb { get; set; } + /// The memory of the Infra VM in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The memory of the Infra VM in the cluster in MB.", + SerializedName = @"clusterInfraVmMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterInfraVMMemoryMb { get; set; } + /// The memory used by VMs in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The memory used by VMs in the cluster in MB.", + SerializedName = @"clusterMemoryUsedByVmsMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterMemoryUsedByVmsMb { get; set; } + /// The non-failover memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The non-failover memory in the cluster in MB.", + SerializedName = @"clusterNonFailoverVmMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterNonFailoverVMMb { get; set; } + /// The total memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total memory in the cluster in MB.", + SerializedName = @"clusterTotalMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterTotalMemoryMb { get; set; } + /// The used memory in the cluster in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The used memory in the cluster in MB.", + SerializedName = @"clusterUsedMemoryMb", + PossibleTypes = new [] { typeof(double) })] + double? MemoryCapacityClusterUsedMemoryMb { get; set; } + /// The dictionary of individual node names and node capacities in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The dictionary of individual node names and node capacities in the cluster.", + SerializedName = @"nodeCapacityInfos", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos NodeCapacityInfo { get; set; } + /// Timestamp of request in UTC + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Timestamp of request in UTC", + SerializedName = @"timeStamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimeStamp { get; set; } + + } + /// The properties of Device Capacity Info + internal partial interface IDeviceCapacityInfoPropertiesInternal + + { + /// Cluster capacity data for compute resources (Memory and GPU). + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterCapacityViewData ClusterComputeCapacityInfo { get; set; } + /// The FQDN of the cluster. + string ClusterComputeCapacityInfoFqdn { get; set; } + /// The cluster's GPU capacity. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterGpuCapacity ClusterComputeCapacityInfoGpuCapacity { get; set; } + /// The last time at which the ClusterCapacityViewData was set. + global::System.DateTime? ClusterComputeCapacityInfoLastRefreshedTime { get; set; } + /// The cluster's memory capacity. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterMemoryCapacity ClusterComputeCapacityInfoMemoryCapacity { get; set; } + /// The total # of vCPUs provisioned by non-HPN VM per appliance. + long? ClusterComputeCapacityInfoTotalProvisionedNonHpnCore { get; set; } + /// Cluster capacity data for storage resources (CSV). + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClusterStorageViewData ClusterStorageCapacityInfo { get; set; } + /// The available or free storage on the cluster in MB. + double? ClusterStorageCapacityInfoClusterFreeStorageMb { get; set; } + /// Total storage on the cluster in MB. + double? ClusterStorageCapacityInfoClusterTotalStorageMb { get; set; } + /// The free GPU units count in the cluster. + int? GpuCapacityGpuFreeUnitsCount { get; set; } + /// The GPU units count reserved for failover in the cluster. + int? GpuCapacityGpuReservedForFailoverUnitsCount { get; set; } + /// The total GPU units count in the cluster. + int? GpuCapacityGpuTotalUnitsCount { get; set; } + /// The cluster GPU Type. + string GpuCapacityGpuType { get; set; } + /// The used GPU units count in the cluster. + int? GpuCapacityGpuUsedUnitsCount { get; set; } + /// The failover memory in the cluster in MB. + double? MemoryCapacityClusterFailoverMemoryMb { get; set; } + /// The fragmentation memory in the cluster in MB. + double? MemoryCapacityClusterFragmentationMemoryMb { get; set; } + /// The free memory in the cluster in MB. + double? MemoryCapacityClusterFreeMemoryMb { get; set; } + /// The memory reserved for Hyper-V in the cluster in MB. + double? MemoryCapacityClusterHypervReserveMemoryMb { get; set; } + /// The memory of the Infra VM in the cluster in MB. + double? MemoryCapacityClusterInfraVMMemoryMb { get; set; } + /// The memory used by VMs in the cluster in MB. + double? MemoryCapacityClusterMemoryUsedByVmsMb { get; set; } + /// The non-failover memory in the cluster in MB. + double? MemoryCapacityClusterNonFailoverVMMb { get; set; } + /// The total memory in the cluster in MB. + double? MemoryCapacityClusterTotalMemoryMb { get; set; } + /// The used memory in the cluster in MB. + double? MemoryCapacityClusterUsedMemoryMb { get; set; } + /// The dictionary of individual node names and node capacities in the cluster. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos NodeCapacityInfo { get; set; } + /// Timestamp of request in UTC + global::System.DateTime? TimeStamp { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoProperties.json.cs new file mode 100644 index 000000000000..8cf6555fb137 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The properties of Device Capacity Info + public partial class DeviceCapacityInfoProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DeviceCapacityInfoProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_clusterStorageCapacityInfo = If( json?.PropertyT("clusterStorageCapacityInfo"), out var __jsonClusterStorageCapacityInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterStorageViewData.FromJson(__jsonClusterStorageCapacityInfo) : ClusterStorageCapacityInfo;} + {_clusterComputeCapacityInfo = If( json?.PropertyT("clusterComputeCapacityInfo"), out var __jsonClusterComputeCapacityInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClusterCapacityViewData.FromJson(__jsonClusterComputeCapacityInfo) : ClusterComputeCapacityInfo;} + {_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;} + {_nodeCapacityInfo = If( json?.PropertyT("nodeCapacityInfos"), out var __jsonNodeCapacityInfos) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityInfoPropertiesNodeCapacityInfos.FromJson(__jsonNodeCapacityInfos) : NodeCapacityInfo;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DeviceCapacityInfoProperties(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._clusterStorageCapacityInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._clusterStorageCapacityInfo.ToJson(null,serializationMode) : null, "clusterStorageCapacityInfo" ,container.Add ); + AddIf( null != this._clusterComputeCapacityInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._clusterComputeCapacityInfo.ToJson(null,serializationMode) : null, "clusterComputeCapacityInfo" ,container.Add ); + AddIf( null != this._timeStamp ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._timeStamp?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "timeStamp" ,container.Add ); + AddIf( null != this._nodeCapacityInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._nodeCapacityInfo.ToJson(null,serializationMode) : null, "nodeCapacityInfos" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoPropertiesNodeCapacityInfos.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoPropertiesNodeCapacityInfos.PowerShell.cs new file mode 100644 index 000000000000..5bc1927faae0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoPropertiesNodeCapacityInfos.PowerShell.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The dictionary of individual node names and node capacities in the cluster. + [System.ComponentModel.TypeConverter(typeof(DeviceCapacityInfoPropertiesNodeCapacityInfosTypeConverter))] + public partial class DeviceCapacityInfoPropertiesNodeCapacityInfos + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeviceCapacityInfoPropertiesNodeCapacityInfos(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.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeviceCapacityInfoPropertiesNodeCapacityInfos(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DeviceCapacityInfoPropertiesNodeCapacityInfos(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 DeviceCapacityInfoPropertiesNodeCapacityInfos(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); + } + + /// + /// 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.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The dictionary of individual node names and node capacities in the cluster. + [System.ComponentModel.TypeConverter(typeof(DeviceCapacityInfoPropertiesNodeCapacityInfosTypeConverter))] + public partial interface IDeviceCapacityInfoPropertiesNodeCapacityInfos + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoPropertiesNodeCapacityInfos.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoPropertiesNodeCapacityInfos.TypeConverter.cs new file mode 100644 index 000000000000..4dde791f03ca --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoPropertiesNodeCapacityInfos.TypeConverter.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DeviceCapacityInfoPropertiesNodeCapacityInfosTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DeviceCapacityInfoPropertiesNodeCapacityInfos.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DeviceCapacityInfoPropertiesNodeCapacityInfos.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DeviceCapacityInfoPropertiesNodeCapacityInfos.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/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoPropertiesNodeCapacityInfos.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoPropertiesNodeCapacityInfos.cs new file mode 100644 index 000000000000..a12db87b0444 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoPropertiesNodeCapacityInfos.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The dictionary of individual node names and node capacities in the cluster. + public partial class DeviceCapacityInfoPropertiesNodeCapacityInfos : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfosInternal + { + + /// + /// Creates an new instance. + /// + public DeviceCapacityInfoPropertiesNodeCapacityInfos() + { + + } + } + /// The dictionary of individual node names and node capacities in the cluster. + public partial interface IDeviceCapacityInfoPropertiesNodeCapacityInfos : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray + { + + } + /// The dictionary of individual node names and node capacities in the cluster. + internal partial interface IDeviceCapacityInfoPropertiesNodeCapacityInfosInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoPropertiesNodeCapacityInfos.dictionary.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoPropertiesNodeCapacityInfos.dictionary.cs new file mode 100644 index 000000000000..f99d0ce67df0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoPropertiesNodeCapacityInfos.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + public partial class DeviceCapacityInfoPropertiesNodeCapacityInfos : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacity this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacity 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.DataBoxEdge.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.DataBoxEdge.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 Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacity value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityInfoPropertiesNodeCapacityInfos source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoPropertiesNodeCapacityInfos.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoPropertiesNodeCapacityInfos.json.cs new file mode 100644 index 000000000000..6236589b112f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityInfoPropertiesNodeCapacityInfos.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The dictionary of individual node names and node capacities in the cluster. + public partial class DeviceCapacityInfoPropertiesNodeCapacityInfos + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + /// + internal DeviceCapacityInfoPropertiesNodeCapacityInfos(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.HostCapacity.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfoPropertiesNodeCapacityInfos FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DeviceCapacityInfoPropertiesNodeCapacityInfos(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfo.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfo.PowerShell.cs new file mode 100644 index 000000000000..39392d1fd011 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Object for Capturing DeviceCapacityRequestInfo + [System.ComponentModel.TypeConverter(typeof(DeviceCapacityRequestInfoTypeConverter))] + public partial class DeviceCapacityRequestInfo + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeviceCapacityRequestInfo(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.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeviceCapacityRequestInfo(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DeviceCapacityRequestInfo(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.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityRequestInfoPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("VMPlacementQuery")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoInternal)this).VMPlacementQuery = (string[][]) content.GetValueForProperty("VMPlacementQuery",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoInternal)this).VMPlacementQuery, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, global::System.Convert.ToString))); + } + if (content.Contains("VMPlacementResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoInternal)this).VMPlacementResult = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult[]) content.GetValueForProperty("VMPlacementResult",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoInternal)this).VMPlacementResult, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.VMPlacementRequestResultTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DeviceCapacityRequestInfo(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.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityRequestInfoPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("VMPlacementQuery")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoInternal)this).VMPlacementQuery = (string[][]) content.GetValueForProperty("VMPlacementQuery",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoInternal)this).VMPlacementQuery, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, global::System.Convert.ToString))); + } + if (content.Contains("VMPlacementResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoInternal)this).VMPlacementResult = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult[]) content.GetValueForProperty("VMPlacementResult",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoInternal)this).VMPlacementResult, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.VMPlacementRequestResultTypeConverter.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.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Object for Capturing DeviceCapacityRequestInfo + [System.ComponentModel.TypeConverter(typeof(DeviceCapacityRequestInfoTypeConverter))] + public partial interface IDeviceCapacityRequestInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfo.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfo.TypeConverter.cs new file mode 100644 index 000000000000..6f690373bc60 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DeviceCapacityRequestInfoTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DeviceCapacityRequestInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DeviceCapacityRequestInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DeviceCapacityRequestInfo.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/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfo.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfo.cs new file mode 100644 index 000000000000..f1fb1ab7a47f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfo.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Object for Capturing DeviceCapacityRequestInfo + public partial class DeviceCapacityRequestInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoInternal + { + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityRequestInfoProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoProperties _property; + + /// The properties of the Device Capacity Request. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityRequestInfoProperties()); set => this._property = value; } + + /// + /// Array containing the sizes of the VMs for checking if its feasible to create them on the appliance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string[][] VMPlacementQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoPropertiesInternal)Property).VMPlacementQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoPropertiesInternal)Property).VMPlacementQuery = value ; } + + /// Array of the VMs of the sizes in VmSizes can be provisioned on the appliance. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult[] VMPlacementResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoPropertiesInternal)Property).VMPlacementResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoPropertiesInternal)Property).VMPlacementResult = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public DeviceCapacityRequestInfo() + { + + } + } + /// Object for Capturing DeviceCapacityRequestInfo + public partial interface IDeviceCapacityRequestInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// + /// Array containing the sizes of the VMs for checking if its feasible to create them on the appliance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Array containing the sizes of the VMs for checking if its feasible to create them on the appliance.", + SerializedName = @"vmPlacementQuery", + PossibleTypes = new [] { typeof(string) })] + string[][] VMPlacementQuery { get; set; } + /// Array of the VMs of the sizes in VmSizes can be provisioned on the appliance. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of the VMs of the sizes in VmSizes can be provisioned on the appliance.", + SerializedName = @"vmPlacementResults", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult[] VMPlacementResult { get; set; } + + } + /// Object for Capturing DeviceCapacityRequestInfo + internal partial interface IDeviceCapacityRequestInfoInternal + + { + /// The properties of the Device Capacity Request. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoProperties Property { get; set; } + /// + /// Array containing the sizes of the VMs for checking if its feasible to create them on the appliance. + /// + string[][] VMPlacementQuery { get; set; } + /// Array of the VMs of the sizes in VmSizes can be provisioned on the appliance. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult[] VMPlacementResult { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfo.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfo.json.cs new file mode 100644 index 000000000000..777e116bb72b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfo.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Object for Capturing DeviceCapacityRequestInfo + public partial class DeviceCapacityRequestInfo + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DeviceCapacityRequestInfo(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.DeviceCapacityRequestInfoProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DeviceCapacityRequestInfo(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfoProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfoProperties.PowerShell.cs new file mode 100644 index 000000000000..66e881330123 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfoProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// Properties of Device Capacity Request Info containing VM's to be checked and their corresponding results. + /// + [System.ComponentModel.TypeConverter(typeof(DeviceCapacityRequestInfoPropertiesTypeConverter))] + public partial class DeviceCapacityRequestInfoProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeviceCapacityRequestInfoProperties(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.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeviceCapacityRequestInfoProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DeviceCapacityRequestInfoProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("VMPlacementQuery")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoPropertiesInternal)this).VMPlacementQuery = (string[][]) content.GetValueForProperty("VMPlacementQuery",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoPropertiesInternal)this).VMPlacementQuery, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, global::System.Convert.ToString))); + } + if (content.Contains("VMPlacementResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoPropertiesInternal)this).VMPlacementResult = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult[]) content.GetValueForProperty("VMPlacementResult",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoPropertiesInternal)this).VMPlacementResult, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.VMPlacementRequestResultTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DeviceCapacityRequestInfoProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("VMPlacementQuery")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoPropertiesInternal)this).VMPlacementQuery = (string[][]) content.GetValueForProperty("VMPlacementQuery",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoPropertiesInternal)this).VMPlacementQuery, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, global::System.Convert.ToString))); + } + if (content.Contains("VMPlacementResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoPropertiesInternal)this).VMPlacementResult = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult[]) content.GetValueForProperty("VMPlacementResult",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoPropertiesInternal)this).VMPlacementResult, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.VMPlacementRequestResultTypeConverter.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.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of Device Capacity Request Info containing VM's to be checked and their corresponding results. + [System.ComponentModel.TypeConverter(typeof(DeviceCapacityRequestInfoPropertiesTypeConverter))] + public partial interface IDeviceCapacityRequestInfoProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfoProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfoProperties.TypeConverter.cs new file mode 100644 index 000000000000..4fd44def1865 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfoProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DeviceCapacityRequestInfoPropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DeviceCapacityRequestInfoProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DeviceCapacityRequestInfoProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DeviceCapacityRequestInfoProperties.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/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfoProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfoProperties.cs new file mode 100644 index 000000000000..3004d2f9380f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfoProperties.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// Properties of Device Capacity Request Info containing VM's to be checked and their corresponding results. + /// + public partial class DeviceCapacityRequestInfoProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoPropertiesInternal + { + + /// Backing field for property. + private string[][] _vMPlacementQuery; + + /// + /// Array containing the sizes of the VMs for checking if its feasible to create them on the appliance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string[][] VMPlacementQuery { get => this._vMPlacementQuery; set => this._vMPlacementQuery = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult[] _vMPlacementResult; + + /// Array of the VMs of the sizes in VmSizes can be provisioned on the appliance. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult[] VMPlacementResult { get => this._vMPlacementResult; set => this._vMPlacementResult = value; } + + /// Creates an new instance. + public DeviceCapacityRequestInfoProperties() + { + + } + } + /// Properties of Device Capacity Request Info containing VM's to be checked and their corresponding results. + public partial interface IDeviceCapacityRequestInfoProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// + /// Array containing the sizes of the VMs for checking if its feasible to create them on the appliance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Array containing the sizes of the VMs for checking if its feasible to create them on the appliance.", + SerializedName = @"vmPlacementQuery", + PossibleTypes = new [] { typeof(string) })] + string[][] VMPlacementQuery { get; set; } + /// Array of the VMs of the sizes in VmSizes can be provisioned on the appliance. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of the VMs of the sizes in VmSizes can be provisioned on the appliance.", + SerializedName = @"vmPlacementResults", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult[] VMPlacementResult { get; set; } + + } + /// Properties of Device Capacity Request Info containing VM's to be checked and their corresponding results. + internal partial interface IDeviceCapacityRequestInfoPropertiesInternal + + { + /// + /// Array containing the sizes of the VMs for checking if its feasible to create them on the appliance. + /// + string[][] VMPlacementQuery { get; set; } + /// Array of the VMs of the sizes in VmSizes can be provisioned on the appliance. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult[] VMPlacementResult { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfoProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfoProperties.json.cs new file mode 100644 index 000000000000..00548cec6e6d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DeviceCapacityRequestInfoProperties.json.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// Properties of Device Capacity Request Info containing VM's to be checked and their corresponding results. + /// + public partial class DeviceCapacityRequestInfoProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DeviceCapacityRequestInfoProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_vMPlacementQuery = If( json?.PropertyT("vmPlacementQuery"), out var __jsonVMPlacementQuery) ? If( __jsonVMPlacementQuery as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonArray, out var __u) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__u, (__t)=>(string[]) (If( __t as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonArray, out var __s) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__s, (__r)=>(string) (__r is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString __q ? (string)(__q.ToString()) : null)) ))() : null /* arrayOf */)) ))() : null : VMPlacementQuery;} + {_vMPlacementResult = If( json?.PropertyT("vmPlacementResults"), out var __jsonVMPlacementResults) ? If( __jsonVMPlacementResults as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonArray, out var __n) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__n, (__m)=>(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.VMPlacementRequestResult.FromJson(__m) )) ))() : null : VMPlacementResult;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfoProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DeviceCapacityRequestInfoProperties(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._vMPlacementQuery) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._vMPlacementQuery ) + { + AddIf(null != __x ? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(global::System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Select(__x, (__v) => null != (((object)__v)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(__v.ToString()) : null))) : null ,__w.Add); + } + container.Add("vmPlacementQuery",__w); + } + if (null != this._vMPlacementResult) + { + var __o = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __p in this._vMPlacementResult ) + { + AddIf(__p?.ToJson(null, serializationMode) ,__o.Add); + } + container.Add("vmPlacementResults",__o); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticProactiveLogCollectionSettings.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticProactiveLogCollectionSettings.PowerShell.cs new file mode 100644 index 000000000000..5b9fcf7cdc72 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticProactiveLogCollectionSettings.PowerShell.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The diagnostic proactive log collection settings of a device. + [System.ComponentModel.TypeConverter(typeof(DiagnosticProactiveLogCollectionSettingsTypeConverter))] + public partial class DiagnosticProactiveLogCollectionSettings + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DiagnosticProactiveLogCollectionSettings(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.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DiagnosticProactiveLogCollectionSettings(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DiagnosticProactiveLogCollectionSettings(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.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ProactiveLogCollectionSettingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UserConsent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).UserConsent = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent) content.GetValueForProperty("UserConsent",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).UserConsent, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataLastModifiedAt, (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 DiagnosticProactiveLogCollectionSettings(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.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ProactiveLogCollectionSettingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UserConsent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).UserConsent = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent) content.GetValueForProperty("UserConsent",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).UserConsent, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + 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.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The diagnostic proactive log collection settings of a device. + [System.ComponentModel.TypeConverter(typeof(DiagnosticProactiveLogCollectionSettingsTypeConverter))] + public partial interface IDiagnosticProactiveLogCollectionSettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticProactiveLogCollectionSettings.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticProactiveLogCollectionSettings.TypeConverter.cs new file mode 100644 index 000000000000..3ee006ef7374 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticProactiveLogCollectionSettings.TypeConverter.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DiagnosticProactiveLogCollectionSettingsTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DiagnosticProactiveLogCollectionSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DiagnosticProactiveLogCollectionSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DiagnosticProactiveLogCollectionSettings.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/databoxedge/generated/api/Models/Api20220301/DiagnosticProactiveLogCollectionSettings.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticProactiveLogCollectionSettings.cs new file mode 100644 index 000000000000..5e8371d82c30 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticProactiveLogCollectionSettings.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The diagnostic proactive log collection settings of a device. + public partial class DiagnosticProactiveLogCollectionSettings : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ProactiveLogCollectionSettingsProperties()); set { {_property = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettingsInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsProperties _property; + + /// Properties of the diagnostic proactive log collection settings. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ProactiveLogCollectionSettingsProperties()); set => this._property = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// + /// Metadata pertaining to creation and last modification of DiagnosticProactiveLogCollectionSettings + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Proactive diagnostic collection consent flag + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent UserConsent { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsPropertiesInternal)Property).UserConsent; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsPropertiesInternal)Property).UserConsent = value ; } + + /// + /// Creates an new instance. + /// + public DiagnosticProactiveLogCollectionSettings() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// The diagnostic proactive log collection settings of a device. + public partial interface IDiagnosticProactiveLogCollectionSettings : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Proactive diagnostic collection consent flag + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Proactive diagnostic collection consent flag", + SerializedName = @"userConsent", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent UserConsent { get; set; } + + } + /// The diagnostic proactive log collection settings of a device. + internal partial interface IDiagnosticProactiveLogCollectionSettingsInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// Properties of the diagnostic proactive log collection settings. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsProperties Property { get; set; } + /// + /// Metadata pertaining to creation and last modification of DiagnosticProactiveLogCollectionSettings + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Proactive diagnostic collection consent flag + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent UserConsent { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticProactiveLogCollectionSettings.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticProactiveLogCollectionSettings.json.cs new file mode 100644 index 000000000000..1b48540a3ffe --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticProactiveLogCollectionSettings.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The diagnostic proactive log collection settings of a device. + public partial class DiagnosticProactiveLogCollectionSettings + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DiagnosticProactiveLogCollectionSettings(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ProactiveLogCollectionSettingsProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DiagnosticProactiveLogCollectionSettings(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettings.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettings.PowerShell.cs new file mode 100644 index 000000000000..d8cc5cfb68aa --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettings.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The remote support settings of a device. + [System.ComponentModel.TypeConverter(typeof(DiagnosticRemoteSupportSettingsTypeConverter))] + public partial class DiagnosticRemoteSupportSettings + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DiagnosticRemoteSupportSettings(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.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DiagnosticRemoteSupportSettings(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DiagnosticRemoteSupportSettings(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.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DiagnosticRemoteSupportSettingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RemoteSupportSettingsList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).RemoteSupportSettingsList = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings[]) content.GetValueForProperty("RemoteSupportSettingsList",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).RemoteSupportSettingsList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RemoteSupportSettingsTypeConverter.ConvertFrom)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataLastModifiedAt, (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 DiagnosticRemoteSupportSettings(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.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DiagnosticRemoteSupportSettingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RemoteSupportSettingsList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).RemoteSupportSettingsList = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings[]) content.GetValueForProperty("RemoteSupportSettingsList",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).RemoteSupportSettingsList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RemoteSupportSettingsTypeConverter.ConvertFrom)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + 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.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The remote support settings of a device. + [System.ComponentModel.TypeConverter(typeof(DiagnosticRemoteSupportSettingsTypeConverter))] + public partial interface IDiagnosticRemoteSupportSettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettings.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettings.TypeConverter.cs new file mode 100644 index 000000000000..df2a7519fee4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettings.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DiagnosticRemoteSupportSettingsTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DiagnosticRemoteSupportSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DiagnosticRemoteSupportSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DiagnosticRemoteSupportSettings.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/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettings.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettings.cs new file mode 100644 index 000000000000..fd94c910b1f0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettings.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The remote support settings of a device. + public partial class DiagnosticRemoteSupportSettings : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DiagnosticRemoteSupportSettingsProperties()); set { {_property = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsProperties _property; + + /// Properties of the remote support settings. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DiagnosticRemoteSupportSettingsProperties()); set => this._property = value; } + + /// Remote support settings list according to the RemoteApplicationType + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings[] RemoteSupportSettingsList { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsPropertiesInternal)Property).RemoteSupportSettingsList; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsPropertiesInternal)Property).RemoteSupportSettingsList = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// Represents resource creation and updation time + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Creates an new instance. + public DiagnosticRemoteSupportSettings() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// The remote support settings of a device. + public partial interface IDiagnosticRemoteSupportSettings : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// Remote support settings list according to the RemoteApplicationType + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Remote support settings list according to the RemoteApplicationType", + SerializedName = @"remoteSupportSettingsList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings[] RemoteSupportSettingsList { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// The remote support settings of a device. + internal partial interface IDiagnosticRemoteSupportSettingsInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// Properties of the remote support settings. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsProperties Property { get; set; } + /// Remote support settings list according to the RemoteApplicationType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings[] RemoteSupportSettingsList { get; set; } + /// Represents resource creation and updation time + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettings.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettings.json.cs new file mode 100644 index 000000000000..b3abaf6c289a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettings.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The remote support settings of a device. + public partial class DiagnosticRemoteSupportSettings + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DiagnosticRemoteSupportSettings(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DiagnosticRemoteSupportSettingsProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DiagnosticRemoteSupportSettings(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettingsProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettingsProperties.PowerShell.cs new file mode 100644 index 000000000000..f4a4b52b1710 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettingsProperties.PowerShell.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The properties of remote support settings. + [System.ComponentModel.TypeConverter(typeof(DiagnosticRemoteSupportSettingsPropertiesTypeConverter))] + public partial class DiagnosticRemoteSupportSettingsProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DiagnosticRemoteSupportSettingsProperties(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.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DiagnosticRemoteSupportSettingsProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DiagnosticRemoteSupportSettingsProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RemoteSupportSettingsList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsPropertiesInternal)this).RemoteSupportSettingsList = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings[]) content.GetValueForProperty("RemoteSupportSettingsList",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsPropertiesInternal)this).RemoteSupportSettingsList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RemoteSupportSettingsTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DiagnosticRemoteSupportSettingsProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RemoteSupportSettingsList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsPropertiesInternal)this).RemoteSupportSettingsList = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings[]) content.GetValueForProperty("RemoteSupportSettingsList",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsPropertiesInternal)this).RemoteSupportSettingsList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RemoteSupportSettingsTypeConverter.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.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of remote support settings. + [System.ComponentModel.TypeConverter(typeof(DiagnosticRemoteSupportSettingsPropertiesTypeConverter))] + public partial interface IDiagnosticRemoteSupportSettingsProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettingsProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettingsProperties.TypeConverter.cs new file mode 100644 index 000000000000..9e3e9e778e32 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettingsProperties.TypeConverter.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DiagnosticRemoteSupportSettingsPropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DiagnosticRemoteSupportSettingsProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DiagnosticRemoteSupportSettingsProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DiagnosticRemoteSupportSettingsProperties.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/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettingsProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettingsProperties.cs new file mode 100644 index 000000000000..f2feef6f9483 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettingsProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The properties of remote support settings. + public partial class DiagnosticRemoteSupportSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings[] _remoteSupportSettingsList; + + /// Remote support settings list according to the RemoteApplicationType + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings[] RemoteSupportSettingsList { get => this._remoteSupportSettingsList; set => this._remoteSupportSettingsList = value; } + + /// + /// Creates an new instance. + /// + public DiagnosticRemoteSupportSettingsProperties() + { + + } + } + /// The properties of remote support settings. + public partial interface IDiagnosticRemoteSupportSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Remote support settings list according to the RemoteApplicationType + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Remote support settings list according to the RemoteApplicationType", + SerializedName = @"remoteSupportSettingsList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings[] RemoteSupportSettingsList { get; set; } + + } + /// The properties of remote support settings. + internal partial interface IDiagnosticRemoteSupportSettingsPropertiesInternal + + { + /// Remote support settings list according to the RemoteApplicationType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings[] RemoteSupportSettingsList { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettingsProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettingsProperties.json.cs new file mode 100644 index 000000000000..18a6760ac5ff --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/DiagnosticRemoteSupportSettingsProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The properties of remote support settings. + public partial class DiagnosticRemoteSupportSettingsProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DiagnosticRemoteSupportSettingsProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_remoteSupportSettingsList = If( json?.PropertyT("remoteSupportSettingsList"), out var __jsonRemoteSupportSettingsList) ? If( __jsonRemoteSupportSettingsList as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RemoteSupportSettings.FromJson(__u) )) ))() : null : RemoteSupportSettingsList;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettingsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DiagnosticRemoteSupportSettingsProperties(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._remoteSupportSettingsList) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._remoteSupportSettingsList ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("remoteSupportSettingsList",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfile.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfile.PowerShell.cs new file mode 100644 index 000000000000..096dcc5162c7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfile.PowerShell.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Details about Edge Profile for the resource + [System.ComponentModel.TypeConverter(typeof(EdgeProfileTypeConverter))] + public partial class EdgeProfile + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IEdgeProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EdgeProfile(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.DataBoxEdge.Models.Api20220301.IEdgeProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EdgeProfile(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EdgeProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Subscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).Subscription = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription) content.GetValueForProperty("Subscription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).Subscription, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionProperty = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties) content.GetValueForProperty("SubscriptionProperty",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionProperty, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState?) content.GetValueForProperty("SubscriptionState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState.CreateFrom); + } + if (content.Contains("SubscriptionRegistrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionRegistrationId = (string) content.GetValueForProperty("SubscriptionRegistrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionRegistrationId, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionRegistrationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionRegistrationDate = (string) content.GetValueForProperty("SubscriptionRegistrationDate",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionRegistrationDate, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("QuotaId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).QuotaId = (string) content.GetValueForProperty("QuotaId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).QuotaId, global::System.Convert.ToString); + } + if (content.Contains("SerializedDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SerializedDetail = (string) content.GetValueForProperty("SerializedDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SerializedDetail, global::System.Convert.ToString); + } + if (content.Contains("RegisteredFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).RegisteredFeature = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[]) content.GetValueForProperty("RegisteredFeature",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).RegisteredFeature, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionRegisteredFeaturesTypeConverter.ConvertFrom)); + } + if (content.Contains("LocationPlacementId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).LocationPlacementId = (string) content.GetValueForProperty("LocationPlacementId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).LocationPlacementId, 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 EdgeProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Subscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).Subscription = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription) content.GetValueForProperty("Subscription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).Subscription, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionProperty = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties) content.GetValueForProperty("SubscriptionProperty",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionProperty, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState?) content.GetValueForProperty("SubscriptionState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState.CreateFrom); + } + if (content.Contains("SubscriptionRegistrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionRegistrationId = (string) content.GetValueForProperty("SubscriptionRegistrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionRegistrationId, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionRegistrationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionRegistrationDate = (string) content.GetValueForProperty("SubscriptionRegistrationDate",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionRegistrationDate, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("QuotaId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).QuotaId = (string) content.GetValueForProperty("QuotaId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).QuotaId, global::System.Convert.ToString); + } + if (content.Contains("SerializedDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SerializedDetail = (string) content.GetValueForProperty("SerializedDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).SerializedDetail, global::System.Convert.ToString); + } + if (content.Contains("RegisteredFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).RegisteredFeature = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[]) content.GetValueForProperty("RegisteredFeature",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).RegisteredFeature, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionRegisteredFeaturesTypeConverter.ConvertFrom)); + } + if (content.Contains("LocationPlacementId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).LocationPlacementId = (string) content.GetValueForProperty("LocationPlacementId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal)this).LocationPlacementId, 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.DataBoxEdge.Models.Api20220301.IEdgeProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Details about Edge Profile for the resource + [System.ComponentModel.TypeConverter(typeof(EdgeProfileTypeConverter))] + public partial interface IEdgeProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfile.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfile.TypeConverter.cs new file mode 100644 index 000000000000..ab8a9f055575 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfile.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EdgeProfileTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IEdgeProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EdgeProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EdgeProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EdgeProfile.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/databoxedge/generated/api/Models/Api20220301/EdgeProfile.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfile.cs new file mode 100644 index 000000000000..1b97b0db3efa --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfile.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Details about Edge Profile for the resource + public partial class EdgeProfile : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal + { + + /// ARM ID of the subscription + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).Id = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string LocationPlacementId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).LocationPlacementId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).LocationPlacementId = value ?? null; } + + /// Internal Acessors for Subscription + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal.Subscription { get => (this._subscription = this._subscription ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscription()); set { {_subscription = value;} } } + + /// Internal Acessors for SubscriptionProperty + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileInternal.SubscriptionProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).Property = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string QuotaId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).QuotaId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).QuotaId = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).RegisteredFeature; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).RegisteredFeature = value ?? null /* arrayOf */; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SerializedDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).SerializedDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).SerializedDetail = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription _subscription; + + /// Edge Profile Subscription + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription Subscription { get => (this._subscription = this._subscription ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscription()); set => this._subscription = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).SubscriptionId = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SubscriptionRegistrationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).RegistrationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).RegistrationDate = value ?? null; } + + /// Edge Subscription Registration ID + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SubscriptionRegistrationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).RegistrationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).RegistrationId = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState? SubscriptionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState)""); } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)Subscription).TenantId = value ?? null; } + + /// Creates an new instance. + public EdgeProfile() + { + + } + } + /// Details about Edge Profile for the resource + public partial interface IEdgeProfile : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// ARM ID of the subscription + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ARM ID of the subscription", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"locationPlacementId", + PossibleTypes = new [] { typeof(string) })] + string LocationPlacementId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"quotaId", + PossibleTypes = new [] { typeof(string) })] + string QuotaId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"registeredFeatures", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"serializedDetails", + PossibleTypes = new [] { typeof(string) })] + string SerializedDetail { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"registrationDate", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionRegistrationDate { get; set; } + /// Edge Subscription Registration ID + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Edge Subscription Registration ID", + SerializedName = @"registrationId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionRegistrationId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState? SubscriptionState { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; set; } + + } + /// Details about Edge Profile for the resource + internal partial interface IEdgeProfileInternal + + { + /// ARM ID of the subscription + string Id { get; set; } + + string LocationPlacementId { get; set; } + + string QuotaId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get; set; } + + string SerializedDetail { get; set; } + /// Edge Profile Subscription + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription Subscription { get; set; } + + string SubscriptionId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties SubscriptionProperty { get; set; } + + string SubscriptionRegistrationDate { get; set; } + /// Edge Subscription Registration ID + string SubscriptionRegistrationId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState? SubscriptionState { get; set; } + + string TenantId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfile.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfile.json.cs new file mode 100644 index 000000000000..2e58ea7d4c11 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfile.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Details about Edge Profile for the resource + public partial class EdgeProfile + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal EdgeProfile(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_subscription = If( json?.PropertyT("subscription"), out var __jsonSubscription) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscription.FromJson(__jsonSubscription) : Subscription;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new EdgeProfile(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._subscription ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._subscription.ToJson(null,serializationMode) : null, "subscription" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfilePatch.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfilePatch.PowerShell.cs new file mode 100644 index 000000000000..fd6c4c206bce --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfilePatch.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The Data Box Edge/Gateway Edge Profile patch. + [System.ComponentModel.TypeConverter(typeof(EdgeProfilePatchTypeConverter))] + public partial class EdgeProfilePatch + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IEdgeProfilePatch DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EdgeProfilePatch(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.DataBoxEdge.Models.Api20220301.IEdgeProfilePatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EdgeProfilePatch(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EdgeProfilePatch(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Subscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatchInternal)this).Subscription = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch) content.GetValueForProperty("Subscription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatchInternal)this).Subscription, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionPatchTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatchInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatchInternal)this).SubscriptionId, 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 EdgeProfilePatch(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Subscription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatchInternal)this).Subscription = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch) content.GetValueForProperty("Subscription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatchInternal)this).Subscription, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionPatchTypeConverter.ConvertFrom); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatchInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatchInternal)this).SubscriptionId, 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.DataBoxEdge.Models.Api20220301.IEdgeProfilePatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Data Box Edge/Gateway Edge Profile patch. + [System.ComponentModel.TypeConverter(typeof(EdgeProfilePatchTypeConverter))] + public partial interface IEdgeProfilePatch + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfilePatch.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfilePatch.TypeConverter.cs new file mode 100644 index 000000000000..6c9901bd9ce7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfilePatch.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EdgeProfilePatchTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IEdgeProfilePatch ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatch).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EdgeProfilePatch.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EdgeProfilePatch.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EdgeProfilePatch.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/databoxedge/generated/api/Models/Api20220301/EdgeProfilePatch.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfilePatch.cs new file mode 100644 index 000000000000..570b286ed179 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfilePatch.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The Data Box Edge/Gateway Edge Profile patch. + public partial class EdgeProfilePatch : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatch, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatchInternal + { + + /// Internal Acessors for Subscription + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatchInternal.Subscription { get => (this._subscription = this._subscription ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionPatch()); set { {_subscription = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch _subscription; + + /// The Data Box Edge/Gateway Edge Profile Subscription patch + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch Subscription { get => (this._subscription = this._subscription ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionPatch()); set => this._subscription = value; } + + /// The path ID that uniquely identifies the subscription of the edge profile. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatchInternal)Subscription).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatchInternal)Subscription).Id = value ?? null; } + + /// Creates an new instance. + public EdgeProfilePatch() + { + + } + } + /// The Data Box Edge/Gateway Edge Profile patch. + public partial interface IEdgeProfilePatch : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The path ID that uniquely identifies the subscription of the edge profile. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The path ID that uniquely identifies the subscription of the edge profile.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + + } + /// The Data Box Edge/Gateway Edge Profile patch. + internal partial interface IEdgeProfilePatchInternal + + { + /// The Data Box Edge/Gateway Edge Profile Subscription patch + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch Subscription { get; set; } + /// The path ID that uniquely identifies the subscription of the edge profile. + string SubscriptionId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfilePatch.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfilePatch.json.cs new file mode 100644 index 000000000000..78f3a6fb05cc --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfilePatch.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The Data Box Edge/Gateway Edge Profile patch. + public partial class EdgeProfilePatch + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal EdgeProfilePatch(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_subscription = If( json?.PropertyT("subscription"), out var __jsonSubscription) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EdgeProfileSubscriptionPatch.FromJson(__jsonSubscription) : Subscription;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatch. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatch. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfilePatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new EdgeProfilePatch(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._subscription ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._subscription.ToJson(null,serializationMode) : null, "subscription" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscription.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscription.PowerShell.cs new file mode 100644 index 000000000000..e5df1449f22e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscription.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Subscription details for the Edge Profile + [System.ComponentModel.TypeConverter(typeof(EdgeProfileSubscriptionTypeConverter))] + public partial class EdgeProfileSubscription + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EdgeProfileSubscription(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.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EdgeProfileSubscription(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EdgeProfileSubscription(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.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RegistrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).RegistrationId = (string) content.GetValueForProperty("RegistrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).RegistrationId, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState.CreateFrom); + } + if (content.Contains("RegistrationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).RegistrationDate = (string) content.GetValueForProperty("RegistrationDate",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).RegistrationDate, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("LocationPlacementId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).LocationPlacementId = (string) content.GetValueForProperty("LocationPlacementId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).LocationPlacementId, global::System.Convert.ToString); + } + if (content.Contains("QuotaId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).QuotaId = (string) content.GetValueForProperty("QuotaId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).QuotaId, global::System.Convert.ToString); + } + if (content.Contains("SerializedDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).SerializedDetail = (string) content.GetValueForProperty("SerializedDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).SerializedDetail, global::System.Convert.ToString); + } + if (content.Contains("RegisteredFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).RegisteredFeature = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[]) content.GetValueForProperty("RegisteredFeature",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).RegisteredFeature, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionRegisteredFeaturesTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EdgeProfileSubscription(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.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RegistrationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).RegistrationId = (string) content.GetValueForProperty("RegistrationId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).RegistrationId, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState.CreateFrom); + } + if (content.Contains("RegistrationDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).RegistrationDate = (string) content.GetValueForProperty("RegistrationDate",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).RegistrationDate, global::System.Convert.ToString); + } + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("LocationPlacementId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).LocationPlacementId = (string) content.GetValueForProperty("LocationPlacementId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).LocationPlacementId, global::System.Convert.ToString); + } + if (content.Contains("QuotaId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).QuotaId = (string) content.GetValueForProperty("QuotaId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).QuotaId, global::System.Convert.ToString); + } + if (content.Contains("SerializedDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).SerializedDetail = (string) content.GetValueForProperty("SerializedDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).SerializedDetail, global::System.Convert.ToString); + } + if (content.Contains("RegisteredFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).RegisteredFeature = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[]) content.GetValueForProperty("RegisteredFeature",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal)this).RegisteredFeature, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionRegisteredFeaturesTypeConverter.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.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Subscription details for the Edge Profile + [System.ComponentModel.TypeConverter(typeof(EdgeProfileSubscriptionTypeConverter))] + public partial interface IEdgeProfileSubscription + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscription.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscription.TypeConverter.cs new file mode 100644 index 000000000000..37e462039454 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscription.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EdgeProfileSubscriptionTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EdgeProfileSubscription.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EdgeProfileSubscription.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EdgeProfileSubscription.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/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscription.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscription.cs new file mode 100644 index 000000000000..a6585c9f3b52 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscription.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Subscription details for the Edge Profile + public partial class EdgeProfileSubscription : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal + { + + /// Backing field for property. + private string _id; + + /// ARM ID of the subscription + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string LocationPlacementId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)Property).LocationPlacementId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)Property).LocationPlacementId = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties _property; + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionProperties()); set => this._property = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string QuotaId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)Property).QuotaId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)Property).QuotaId = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)Property).RegisteredFeature; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)Property).RegisteredFeature = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _registrationDate; + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string RegistrationDate { get => this._registrationDate; set => this._registrationDate = value; } + + /// Backing field for property. + private string _registrationId; + + /// Edge Subscription Registration ID + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string RegistrationId { get => this._registrationId; set => this._registrationId = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SerializedDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)Property).SerializedDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)Property).SerializedDetail = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState? _state; + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState? State { get => this._state; set => this._state = value; } + + /// Backing field for property. + private string _subscriptionId; + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)Property).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)Property).TenantId = value ?? null; } + + /// Creates an new instance. + public EdgeProfileSubscription() + { + + } + } + /// Subscription details for the Edge Profile + public partial interface IEdgeProfileSubscription : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// ARM ID of the subscription + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ARM ID of the subscription", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"locationPlacementId", + PossibleTypes = new [] { typeof(string) })] + string LocationPlacementId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"quotaId", + PossibleTypes = new [] { typeof(string) })] + string QuotaId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"registeredFeatures", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"registrationDate", + PossibleTypes = new [] { typeof(string) })] + string RegistrationDate { get; set; } + /// Edge Subscription Registration ID + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Edge Subscription Registration ID", + SerializedName = @"registrationId", + PossibleTypes = new [] { typeof(string) })] + string RegistrationId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"serializedDetails", + PossibleTypes = new [] { typeof(string) })] + string SerializedDetail { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState? State { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; set; } + + } + /// Subscription details for the Edge Profile + internal partial interface IEdgeProfileSubscriptionInternal + + { + /// ARM ID of the subscription + string Id { get; set; } + + string LocationPlacementId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties Property { get; set; } + + string QuotaId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get; set; } + + string RegistrationDate { get; set; } + /// Edge Subscription Registration ID + string RegistrationId { get; set; } + + string SerializedDetail { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState? State { get; set; } + + string SubscriptionId { get; set; } + + string TenantId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscription.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscription.json.cs new file mode 100644 index 000000000000..3a174d75dfb6 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscription.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Subscription details for the Edge Profile + public partial class EdgeProfileSubscription + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal EdgeProfileSubscription(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.SubscriptionProperties.FromJson(__jsonProperties) : Property;} + {_registrationId = If( json?.PropertyT("registrationId"), out var __jsonRegistrationId) ? (string)__jsonRegistrationId : (string)RegistrationId;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_registrationDate = If( json?.PropertyT("registrationDate"), out var __jsonRegistrationDate) ? (string)__jsonRegistrationDate : (string)RegistrationDate;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscription FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new EdgeProfileSubscription(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._registrationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._registrationId.ToString()) : null, "registrationId" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + AddIf( null != (((object)this._registrationDate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._registrationDate.ToString()) : null, "registrationDate" ,container.Add ); + AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscriptionPatch.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscriptionPatch.PowerShell.cs new file mode 100644 index 000000000000..c74726571516 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscriptionPatch.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The Data Box Edge/Gateway Edge Profile Subscription patch. + [System.ComponentModel.TypeConverter(typeof(EdgeProfileSubscriptionPatchTypeConverter))] + public partial class EdgeProfileSubscriptionPatch + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EdgeProfileSubscriptionPatch(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.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EdgeProfileSubscriptionPatch(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EdgeProfileSubscriptionPatch(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.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatchInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatchInternal)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 EdgeProfileSubscriptionPatch(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.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatchInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatchInternal)this).Id, 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.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Data Box Edge/Gateway Edge Profile Subscription patch. + [System.ComponentModel.TypeConverter(typeof(EdgeProfileSubscriptionPatchTypeConverter))] + public partial interface IEdgeProfileSubscriptionPatch + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscriptionPatch.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscriptionPatch.TypeConverter.cs new file mode 100644 index 000000000000..5c0d80c8c6f9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscriptionPatch.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EdgeProfileSubscriptionPatchTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EdgeProfileSubscriptionPatch.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EdgeProfileSubscriptionPatch.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EdgeProfileSubscriptionPatch.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/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscriptionPatch.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscriptionPatch.cs new file mode 100644 index 000000000000..87a40efd7a00 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscriptionPatch.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The Data Box Edge/Gateway Edge Profile Subscription patch. + public partial class EdgeProfileSubscriptionPatch : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatchInternal + { + + /// Backing field for property. + private string _id; + + /// The path ID that uniquely identifies the subscription of the edge profile. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Creates an new instance. + public EdgeProfileSubscriptionPatch() + { + + } + } + /// The Data Box Edge/Gateway Edge Profile Subscription patch. + public partial interface IEdgeProfileSubscriptionPatch : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The path ID that uniquely identifies the subscription of the edge profile. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The path ID that uniquely identifies the subscription of the edge profile.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + + } + /// The Data Box Edge/Gateway Edge Profile Subscription patch. + internal partial interface IEdgeProfileSubscriptionPatchInternal + + { + /// The path ID that uniquely identifies the subscription of the edge profile. + string Id { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscriptionPatch.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscriptionPatch.json.cs new file mode 100644 index 000000000000..1aa052c67019 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EdgeProfileSubscriptionPatch.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The Data Box Edge/Gateway Edge Profile Subscription patch. + public partial class EdgeProfileSubscriptionPatch + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal EdgeProfileSubscriptionPatch(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEdgeProfileSubscriptionPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new EdgeProfileSubscriptionPatch(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/EtcdInfo.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EtcdInfo.PowerShell.cs new file mode 100644 index 000000000000..a4520cd7c6a6 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EtcdInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Etcd configuration + [System.ComponentModel.TypeConverter(typeof(EtcdInfoTypeConverter))] + public partial class EtcdInfo + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IEtcdInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EtcdInfo(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.DataBoxEdge.Models.Api20220301.IEtcdInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EtcdInfo(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EtcdInfo(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.DataBoxEdge.Models.Api20220301.IEtcdInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfoInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfoInternal)this).Version, 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 EtcdInfo(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.DataBoxEdge.Models.Api20220301.IEtcdInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfoInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfoInternal)this).Version, 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.DataBoxEdge.Models.Api20220301.IEtcdInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Etcd configuration + [System.ComponentModel.TypeConverter(typeof(EtcdInfoTypeConverter))] + public partial interface IEtcdInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/EtcdInfo.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EtcdInfo.TypeConverter.cs new file mode 100644 index 000000000000..3c21aabe7496 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EtcdInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EtcdInfoTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IEtcdInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EtcdInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EtcdInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EtcdInfo.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/databoxedge/generated/api/Models/Api20220301/EtcdInfo.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EtcdInfo.cs new file mode 100644 index 000000000000..10a80ba4b4ce --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EtcdInfo.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Etcd configuration + public partial class EtcdInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfoInternal + { + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfoInternal.Type { get => this._type; set { {_type = value;} } } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfoInternal.Version { get => this._version; set { {_version = value;} } } + + /// Backing field for property. + private string _type; + + /// Etcd type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Backing field for property. + private string _version; + + /// Etcd version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Version { get => this._version; } + + /// Creates an new instance. + public EtcdInfo() + { + + } + } + /// Etcd configuration + public partial interface IEtcdInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Etcd type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Etcd type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + /// Etcd version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Etcd version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; } + + } + /// Etcd configuration + internal partial interface IEtcdInfoInternal + + { + /// Etcd type + string Type { get; set; } + /// Etcd version + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/EtcdInfo.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/EtcdInfo.json.cs new file mode 100644 index 000000000000..dea6fb299933 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/EtcdInfo.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Etcd configuration + public partial class EtcdInfo + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal EtcdInfo(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new EtcdInfo(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/FileEventTrigger.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileEventTrigger.PowerShell.cs new file mode 100644 index 000000000000..9d8f8efb26cf --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileEventTrigger.PowerShell.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Trigger details. + [System.ComponentModel.TypeConverter(typeof(FileEventTriggerTypeConverter))] + public partial class FileEventTrigger + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IFileEventTrigger DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileEventTrigger(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.DataBoxEdge.Models.Api20220301.IFileEventTrigger DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileEventTrigger(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileEventTrigger(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.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.FileTriggerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType.CreateFrom); + } + if (content.Contains("SourceInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).SourceInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfo) content.GetValueForProperty("SourceInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).SourceInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.FileSourceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SinkInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).SinkInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo) content.GetValueForProperty("SinkInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).SinkInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleSinkInfoTypeConverter.ConvertFrom); + } + if (content.Contains("CustomContextTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).CustomContextTag = (string) content.GetValueForProperty("CustomContextTag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).CustomContextTag, global::System.Convert.ToString); + } + if (content.Contains("SourceInfoShareId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).SourceInfoShareId = (string) content.GetValueForProperty("SourceInfoShareId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).SourceInfoShareId, global::System.Convert.ToString); + } + if (content.Contains("SinkInfoRoleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).SinkInfoRoleId = (string) content.GetValueForProperty("SinkInfoRoleId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).SinkInfoRoleId, 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 FileEventTrigger(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.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.FileTriggerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType.CreateFrom); + } + if (content.Contains("SourceInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).SourceInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfo) content.GetValueForProperty("SourceInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).SourceInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.FileSourceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SinkInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).SinkInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo) content.GetValueForProperty("SinkInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).SinkInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleSinkInfoTypeConverter.ConvertFrom); + } + if (content.Contains("CustomContextTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).CustomContextTag = (string) content.GetValueForProperty("CustomContextTag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).CustomContextTag, global::System.Convert.ToString); + } + if (content.Contains("SourceInfoShareId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).SourceInfoShareId = (string) content.GetValueForProperty("SourceInfoShareId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).SourceInfoShareId, global::System.Convert.ToString); + } + if (content.Contains("SinkInfoRoleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).SinkInfoRoleId = (string) content.GetValueForProperty("SinkInfoRoleId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal)this).SinkInfoRoleId, 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.DataBoxEdge.Models.Api20220301.IFileEventTrigger FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Trigger details. + [System.ComponentModel.TypeConverter(typeof(FileEventTriggerTypeConverter))] + public partial interface IFileEventTrigger + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/FileEventTrigger.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileEventTrigger.TypeConverter.cs new file mode 100644 index 000000000000..6607ff7bdc70 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileEventTrigger.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileEventTriggerTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IFileEventTrigger ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTrigger).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileEventTrigger.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileEventTrigger.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileEventTrigger.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/databoxedge/generated/api/Models/Api20220301/FileEventTrigger.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileEventTrigger.cs new file mode 100644 index 000000000000..c257cf34fd8a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileEventTrigger.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Trigger details. + public partial class FileEventTrigger : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTrigger, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger __trigger = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Trigger(); + + /// + /// A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger + /// is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CustomContextTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)Property).CustomContextTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)Property).CustomContextTag = value ?? null; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__trigger).Id; } + + /// Trigger Kind. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).Kind = value ; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__trigger).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__trigger).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__trigger).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__trigger).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__trigger).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__trigger).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.FileTriggerProperties()); set { {_property = value;} } } + + /// Internal Acessors for SinkInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal.SinkInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)Property).SinkInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)Property).SinkInfo = value; } + + /// Internal Acessors for SourceInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTriggerInternal.SourceInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)Property).SourceInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)Property).SourceInfo = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemData = value; } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__trigger).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerProperties _property; + + /// File trigger properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.FileTriggerProperties()); set => this._property = value; } + + /// Compute role ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SinkInfoRoleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)Property).SinkInfoRoleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)Property).SinkInfoRoleId = value ; } + + /// File share ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SourceInfoShareId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)Property).SourceInfoShareId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)Property).SourceInfoShareId = value ; } + + /// Metadata pertaining to creation and last modification of Trigger + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__trigger).Type; } + + /// Creates an new instance. + public FileEventTrigger() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trigger), __trigger); + await eventListener.AssertObjectIsValid(nameof(__trigger), __trigger); + } + } + /// Trigger details. + public partial interface IFileEventTrigger : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger + { + /// + /// A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger + /// is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module.", + SerializedName = @"customContextTag", + PossibleTypes = new [] { typeof(string) })] + string CustomContextTag { get; set; } + /// Compute role ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Compute role ID.", + SerializedName = @"roleId", + PossibleTypes = new [] { typeof(string) })] + string SinkInfoRoleId { get; set; } + /// File share ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"File share ID.", + SerializedName = @"shareId", + PossibleTypes = new [] { typeof(string) })] + string SourceInfoShareId { get; set; } + + } + /// Trigger details. + internal partial interface IFileEventTriggerInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal + { + /// + /// A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger + /// is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + /// + string CustomContextTag { get; set; } + /// File trigger properties. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerProperties Property { get; set; } + /// Role sink info. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo SinkInfo { get; set; } + /// Compute role ID. + string SinkInfoRoleId { get; set; } + /// File event source details. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfo SourceInfo { get; set; } + /// File share ID. + string SourceInfoShareId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/FileEventTrigger.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileEventTrigger.json.cs new file mode 100644 index 000000000000..fe39f51adadf --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileEventTrigger.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Trigger details. + public partial class FileEventTrigger + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal FileEventTrigger(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __trigger = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Trigger(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.FileTriggerProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTrigger. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTrigger. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileEventTrigger FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new FileEventTrigger(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __trigger?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/FileSourceInfo.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileSourceInfo.PowerShell.cs new file mode 100644 index 000000000000..1d1cd85fc45f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileSourceInfo.PowerShell.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// File source details. + [System.ComponentModel.TypeConverter(typeof(FileSourceInfoTypeConverter))] + public partial class FileSourceInfo + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IFileSourceInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileSourceInfo(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.DataBoxEdge.Models.Api20220301.IFileSourceInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileSourceInfo(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileSourceInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ShareId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfoInternal)this).ShareId = (string) content.GetValueForProperty("ShareId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfoInternal)this).ShareId, 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 FileSourceInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ShareId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfoInternal)this).ShareId = (string) content.GetValueForProperty("ShareId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfoInternal)this).ShareId, 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.DataBoxEdge.Models.Api20220301.IFileSourceInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// File source details. + [System.ComponentModel.TypeConverter(typeof(FileSourceInfoTypeConverter))] + public partial interface IFileSourceInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/FileSourceInfo.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileSourceInfo.TypeConverter.cs new file mode 100644 index 000000000000..2fd01fb7f744 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileSourceInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileSourceInfoTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IFileSourceInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileSourceInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileSourceInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileSourceInfo.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/databoxedge/generated/api/Models/Api20220301/FileSourceInfo.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileSourceInfo.cs new file mode 100644 index 000000000000..16bff5b507a3 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileSourceInfo.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// File source details. + public partial class FileSourceInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfoInternal + { + + /// Backing field for property. + private string _shareId; + + /// File share ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ShareId { get => this._shareId; set => this._shareId = value; } + + /// Creates an new instance. + public FileSourceInfo() + { + + } + } + /// File source details. + public partial interface IFileSourceInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// File share ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"File share ID.", + SerializedName = @"shareId", + PossibleTypes = new [] { typeof(string) })] + string ShareId { get; set; } + + } + /// File source details. + internal partial interface IFileSourceInfoInternal + + { + /// File share ID. + string ShareId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/FileSourceInfo.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileSourceInfo.json.cs new file mode 100644 index 000000000000..c9fb93d3c840 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileSourceInfo.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// File source details. + public partial class FileSourceInfo + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal FileSourceInfo(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_shareId = If( json?.PropertyT("shareId"), out var __jsonShareId) ? (string)__jsonShareId : (string)ShareId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new FileSourceInfo(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._shareId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._shareId.ToString()) : null, "shareId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/FileTriggerProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileTriggerProperties.PowerShell.cs new file mode 100644 index 000000000000..8bb24b58ac47 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileTriggerProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// File trigger properties. + [System.ComponentModel.TypeConverter(typeof(FileTriggerPropertiesTypeConverter))] + public partial class FileTriggerProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IFileTriggerProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileTriggerProperties(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.DataBoxEdge.Models.Api20220301.IFileTriggerProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileTriggerProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileTriggerProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).SourceInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfo) content.GetValueForProperty("SourceInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).SourceInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.FileSourceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SinkInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).SinkInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo) content.GetValueForProperty("SinkInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).SinkInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleSinkInfoTypeConverter.ConvertFrom); + } + if (content.Contains("CustomContextTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).CustomContextTag = (string) content.GetValueForProperty("CustomContextTag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).CustomContextTag, global::System.Convert.ToString); + } + if (content.Contains("SourceInfoShareId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).SourceInfoShareId = (string) content.GetValueForProperty("SourceInfoShareId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).SourceInfoShareId, global::System.Convert.ToString); + } + if (content.Contains("SinkInfoRoleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).SinkInfoRoleId = (string) content.GetValueForProperty("SinkInfoRoleId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).SinkInfoRoleId, 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 FileTriggerProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).SourceInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfo) content.GetValueForProperty("SourceInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).SourceInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.FileSourceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SinkInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).SinkInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo) content.GetValueForProperty("SinkInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).SinkInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleSinkInfoTypeConverter.ConvertFrom); + } + if (content.Contains("CustomContextTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).CustomContextTag = (string) content.GetValueForProperty("CustomContextTag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).CustomContextTag, global::System.Convert.ToString); + } + if (content.Contains("SourceInfoShareId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).SourceInfoShareId = (string) content.GetValueForProperty("SourceInfoShareId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).SourceInfoShareId, global::System.Convert.ToString); + } + if (content.Contains("SinkInfoRoleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).SinkInfoRoleId = (string) content.GetValueForProperty("SinkInfoRoleId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal)this).SinkInfoRoleId, 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.DataBoxEdge.Models.Api20220301.IFileTriggerProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// File trigger properties. + [System.ComponentModel.TypeConverter(typeof(FileTriggerPropertiesTypeConverter))] + public partial interface IFileTriggerProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/FileTriggerProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileTriggerProperties.TypeConverter.cs new file mode 100644 index 000000000000..5a872426db19 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileTriggerProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileTriggerPropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IFileTriggerProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileTriggerProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileTriggerProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileTriggerProperties.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/databoxedge/generated/api/Models/Api20220301/FileTriggerProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileTriggerProperties.cs new file mode 100644 index 000000000000..299f4d646a80 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileTriggerProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// File trigger properties. + public partial class FileTriggerProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal + { + + /// Backing field for property. + private string _customContextTag; + + /// + /// A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger + /// is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string CustomContextTag { get => this._customContextTag; set => this._customContextTag = value; } + + /// Internal Acessors for SinkInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal.SinkInfo { get => (this._sinkInfo = this._sinkInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleSinkInfo()); set { {_sinkInfo = value;} } } + + /// Internal Acessors for SourceInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerPropertiesInternal.SourceInfo { get => (this._sourceInfo = this._sourceInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.FileSourceInfo()); set { {_sourceInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo _sinkInfo; + + /// Role sink info. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo SinkInfo { get => (this._sinkInfo = this._sinkInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleSinkInfo()); set => this._sinkInfo = value; } + + /// Compute role ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SinkInfoRoleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfoInternal)SinkInfo).RoleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfoInternal)SinkInfo).RoleId = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfo _sourceInfo; + + /// File event source details. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfo SourceInfo { get => (this._sourceInfo = this._sourceInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.FileSourceInfo()); set => this._sourceInfo = value; } + + /// File share ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SourceInfoShareId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfoInternal)SourceInfo).ShareId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfoInternal)SourceInfo).ShareId = value ; } + + /// Creates an new instance. + public FileTriggerProperties() + { + + } + } + /// File trigger properties. + public partial interface IFileTriggerProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// + /// A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger + /// is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module.", + SerializedName = @"customContextTag", + PossibleTypes = new [] { typeof(string) })] + string CustomContextTag { get; set; } + /// Compute role ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Compute role ID.", + SerializedName = @"roleId", + PossibleTypes = new [] { typeof(string) })] + string SinkInfoRoleId { get; set; } + /// File share ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"File share ID.", + SerializedName = @"shareId", + PossibleTypes = new [] { typeof(string) })] + string SourceInfoShareId { get; set; } + + } + /// File trigger properties. + internal partial interface IFileTriggerPropertiesInternal + + { + /// + /// A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger + /// is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + /// + string CustomContextTag { get; set; } + /// Role sink info. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo SinkInfo { get; set; } + /// Compute role ID. + string SinkInfoRoleId { get; set; } + /// File event source details. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileSourceInfo SourceInfo { get; set; } + /// File share ID. + string SourceInfoShareId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/FileTriggerProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileTriggerProperties.json.cs new file mode 100644 index 000000000000..1018da1b7264 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/FileTriggerProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// File trigger properties. + public partial class FileTriggerProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal FileTriggerProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceInfo = If( json?.PropertyT("sourceInfo"), out var __jsonSourceInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.FileSourceInfo.FromJson(__jsonSourceInfo) : SourceInfo;} + {_sinkInfo = If( json?.PropertyT("sinkInfo"), out var __jsonSinkInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleSinkInfo.FromJson(__jsonSinkInfo) : SinkInfo;} + {_customContextTag = If( json?.PropertyT("customContextTag"), out var __jsonCustomContextTag) ? (string)__jsonCustomContextTag : (string)CustomContextTag;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IFileTriggerProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new FileTriggerProperties(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sourceInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._sourceInfo.ToJson(null,serializationMode) : null, "sourceInfo" ,container.Add ); + AddIf( null != this._sinkInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._sinkInfo.ToJson(null,serializationMode) : null, "sinkInfo" ,container.Add ); + AddIf( null != (((object)this._customContextTag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._customContextTag.ToString()) : null, "customContextTag" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/GenerateCertResponse.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/GenerateCertResponse.PowerShell.cs new file mode 100644 index 000000000000..945a81b0ef60 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/GenerateCertResponse.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Used in activation key generation flow. + [System.ComponentModel.TypeConverter(typeof(GenerateCertResponseTypeConverter))] + public partial class GenerateCertResponse + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IGenerateCertResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GenerateCertResponse(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.DataBoxEdge.Models.Api20220301.IGenerateCertResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GenerateCertResponse(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.DataBoxEdge.Models.Api20220301.IGenerateCertResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GenerateCertResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponseInternal)this).PublicKey = (string) content.GetValueForProperty("PublicKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponseInternal)this).PublicKey, global::System.Convert.ToString); + } + if (content.Contains("PrivateKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponseInternal)this).PrivateKey = (string) content.GetValueForProperty("PrivateKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponseInternal)this).PrivateKey, global::System.Convert.ToString); + } + if (content.Contains("ExpiryTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponseInternal)this).ExpiryTimeInUtc = (string) content.GetValueForProperty("ExpiryTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponseInternal)this).ExpiryTimeInUtc, 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 GenerateCertResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponseInternal)this).PublicKey = (string) content.GetValueForProperty("PublicKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponseInternal)this).PublicKey, global::System.Convert.ToString); + } + if (content.Contains("PrivateKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponseInternal)this).PrivateKey = (string) content.GetValueForProperty("PrivateKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponseInternal)this).PrivateKey, global::System.Convert.ToString); + } + if (content.Contains("ExpiryTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponseInternal)this).ExpiryTimeInUtc = (string) content.GetValueForProperty("ExpiryTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponseInternal)this).ExpiryTimeInUtc, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Used in activation key generation flow. + [System.ComponentModel.TypeConverter(typeof(GenerateCertResponseTypeConverter))] + public partial interface IGenerateCertResponse + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/GenerateCertResponse.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/GenerateCertResponse.TypeConverter.cs new file mode 100644 index 000000000000..40cc44ba1437 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/GenerateCertResponse.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GenerateCertResponseTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IGenerateCertResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GenerateCertResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GenerateCertResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GenerateCertResponse.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/databoxedge/generated/api/Models/Api20220301/GenerateCertResponse.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/GenerateCertResponse.cs new file mode 100644 index 000000000000..bf6b9d742ae9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/GenerateCertResponse.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Used in activation key generation flow. + public partial class GenerateCertResponse : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponse, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponseInternal + { + + /// Backing field for property. + private string _expiryTimeInUtc; + + /// Gets or sets expiry time in UTC + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ExpiryTimeInUtc { get => this._expiryTimeInUtc; set => this._expiryTimeInUtc = value; } + + /// Backing field for property. + private string _privateKey; + + /// + /// Gets or sets base64 encoded private part of the certificate, + /// needed to form the activation key + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string PrivateKey { get => this._privateKey; set => this._privateKey = value; } + + /// Backing field for property. + private string _publicKey; + + /// + /// Gets or sets base64 encoded certificate raw data, + /// this is the public part needed to be uploaded to cert vault + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string PublicKey { get => this._publicKey; set => this._publicKey = value; } + + /// Creates an new instance. + public GenerateCertResponse() + { + + } + } + /// Used in activation key generation flow. + public partial interface IGenerateCertResponse : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Gets or sets expiry time in UTC + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets expiry time in UTC", + SerializedName = @"expiryTimeInUTC", + PossibleTypes = new [] { typeof(string) })] + string ExpiryTimeInUtc { get; set; } + /// + /// Gets or sets base64 encoded private part of the certificate, + /// needed to form the activation key + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets base64 encoded private part of the certificate, + needed to form the activation key", + SerializedName = @"privateKey", + PossibleTypes = new [] { typeof(string) })] + string PrivateKey { get; set; } + /// + /// Gets or sets base64 encoded certificate raw data, + /// this is the public part needed to be uploaded to cert vault + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets base64 encoded certificate raw data, + this is the public part needed to be uploaded to cert vault", + SerializedName = @"publicKey", + PossibleTypes = new [] { typeof(string) })] + string PublicKey { get; set; } + + } + /// Used in activation key generation flow. + internal partial interface IGenerateCertResponseInternal + + { + /// Gets or sets expiry time in UTC + string ExpiryTimeInUtc { get; set; } + /// + /// Gets or sets base64 encoded private part of the certificate, + /// needed to form the activation key + /// + string PrivateKey { get; set; } + /// + /// Gets or sets base64 encoded certificate raw data, + /// this is the public part needed to be uploaded to cert vault + /// + string PublicKey { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/GenerateCertResponse.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/GenerateCertResponse.json.cs new file mode 100644 index 000000000000..fb935ed158ed --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/GenerateCertResponse.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Used in activation key generation flow. + public partial class GenerateCertResponse + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new GenerateCertResponse(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal GenerateCertResponse(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_publicKey = If( json?.PropertyT("publicKey"), out var __jsonPublicKey) ? (string)__jsonPublicKey : (string)PublicKey;} + {_privateKey = If( json?.PropertyT("privateKey"), out var __jsonPrivateKey) ? (string)__jsonPrivateKey : (string)PrivateKey;} + {_expiryTimeInUtc = If( json?.PropertyT("expiryTimeInUTC"), out var __jsonExpiryTimeInUtc) ? (string)__jsonExpiryTimeInUtc : (string)ExpiryTimeInUtc;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._publicKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._publicKey.ToString()) : null, "publicKey" ,container.Add ); + AddIf( null != (((object)this._privateKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._privateKey.ToString()) : null, "privateKey" ,container.Add ); + AddIf( null != (((object)this._expiryTimeInUtc)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._expiryTimeInUtc.ToString()) : null, "expiryTimeInUTC" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacity.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacity.PowerShell.cs new file mode 100644 index 000000000000..09efead04bf0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacity.PowerShell.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Host Capacity Data. + [System.ComponentModel.TypeConverter(typeof(HostCapacityTypeConverter))] + public partial class HostCapacity + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IHostCapacity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new HostCapacity(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.DataBoxEdge.Models.Api20220301.IHostCapacity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new HostCapacity(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.DataBoxEdge.Models.Api20220301.IHostCapacity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal HostCapacity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("HostName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).HostName = (string) content.GetValueForProperty("HostName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).HostName, global::System.Convert.ToString); + } + if (content.Contains("EffectiveAvailableMemoryMbOnHost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).EffectiveAvailableMemoryMbOnHost = (long?) content.GetValueForProperty("EffectiveAvailableMemoryMbOnHost",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).EffectiveAvailableMemoryMbOnHost, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AvailableGpuCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).AvailableGpuCount = (int?) content.GetValueForProperty("AvailableGpuCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).AvailableGpuCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("VMUsedMemory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).VMUsedMemory = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityVMUsedMemory) content.GetValueForProperty("VMUsedMemory",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).VMUsedMemory, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.HostCapacityVMUsedMemoryTypeConverter.ConvertFrom); + } + if (content.Contains("GpuType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).GpuType = (string) content.GetValueForProperty("GpuType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).GpuType, global::System.Convert.ToString); + } + if (content.Contains("NumaNodesData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).NumaNodesData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeData[]) content.GetValueForProperty("NumaNodesData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).NumaNodesData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NumaNodeDataTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal HostCapacity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("HostName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).HostName = (string) content.GetValueForProperty("HostName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).HostName, global::System.Convert.ToString); + } + if (content.Contains("EffectiveAvailableMemoryMbOnHost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).EffectiveAvailableMemoryMbOnHost = (long?) content.GetValueForProperty("EffectiveAvailableMemoryMbOnHost",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).EffectiveAvailableMemoryMbOnHost, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AvailableGpuCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).AvailableGpuCount = (int?) content.GetValueForProperty("AvailableGpuCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).AvailableGpuCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("VMUsedMemory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).VMUsedMemory = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityVMUsedMemory) content.GetValueForProperty("VMUsedMemory",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).VMUsedMemory, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.HostCapacityVMUsedMemoryTypeConverter.ConvertFrom); + } + if (content.Contains("GpuType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).GpuType = (string) content.GetValueForProperty("GpuType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).GpuType, global::System.Convert.ToString); + } + if (content.Contains("NumaNodesData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).NumaNodesData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeData[]) content.GetValueForProperty("NumaNodesData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal)this).NumaNodesData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NumaNodeDataTypeConverter.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Host Capacity Data. + [System.ComponentModel.TypeConverter(typeof(HostCapacityTypeConverter))] + public partial interface IHostCapacity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacity.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacity.TypeConverter.cs new file mode 100644 index 000000000000..4e20321eb1ee --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacity.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class HostCapacityTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IHostCapacity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return HostCapacity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return HostCapacity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return HostCapacity.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/databoxedge/generated/api/Models/Api20220301/HostCapacity.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacity.cs new file mode 100644 index 000000000000..f3ddd709908b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacity.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Host Capacity Data. + public partial class HostCapacity : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacity, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityInternal + { + + /// Backing field for property. + private int? _availableGpuCount; + + /// + /// The available amount of GPUs on the host to use after accounting for GPUS used by reservations on the host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? AvailableGpuCount { get => this._availableGpuCount; set => this._availableGpuCount = value; } + + /// Backing field for property. + private long? _effectiveAvailableMemoryMbOnHost; + + /// + /// The available memory on the host accounting for VM placement size and any host VM reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public long? EffectiveAvailableMemoryMbOnHost { get => this._effectiveAvailableMemoryMbOnHost; set => this._effectiveAvailableMemoryMbOnHost = value; } + + /// Backing field for property. + private string _gpuType; + + /// The GPU type of the VM. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string GpuType { get => this._gpuType; set => this._gpuType = value; } + + /// Backing field for property. + private string _hostName; + + /// The name of the host. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string HostName { get => this._hostName; set => this._hostName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeData[] _numaNodesData; + + /// The numa nodes information for Hpn VMs. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeData[] NumaNodesData { get => this._numaNodesData; set => this._numaNodesData = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityVMUsedMemory _vMUsedMemory; + + /// The VM used memory per VmId. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityVMUsedMemory VMUsedMemory { get => (this._vMUsedMemory = this._vMUsedMemory ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.HostCapacityVMUsedMemory()); set => this._vMUsedMemory = value; } + + /// Creates an new instance. + public HostCapacity() + { + + } + } + /// Host Capacity Data. + public partial interface IHostCapacity : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// + /// The available amount of GPUs on the host to use after accounting for GPUS used by reservations on the host. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The available amount of GPUs on the host to use after accounting for GPUS used by reservations on the host.", + SerializedName = @"availableGpuCount", + PossibleTypes = new [] { typeof(int) })] + int? AvailableGpuCount { get; set; } + /// + /// The available memory on the host accounting for VM placement size and any host VM reservations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The available memory on the host accounting for VM placement size and any host VM reservations.", + SerializedName = @"effectiveAvailableMemoryMbOnHost", + PossibleTypes = new [] { typeof(long) })] + long? EffectiveAvailableMemoryMbOnHost { get; set; } + /// The GPU type of the VM. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The GPU type of the VM.", + SerializedName = @"gpuType", + PossibleTypes = new [] { typeof(string) })] + string GpuType { get; set; } + /// The name of the host. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the host.", + SerializedName = @"hostName", + PossibleTypes = new [] { typeof(string) })] + string HostName { get; set; } + /// The numa nodes information for Hpn VMs. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The numa nodes information for Hpn VMs.", + SerializedName = @"numaNodesData", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeData) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeData[] NumaNodesData { get; set; } + /// The VM used memory per VmId. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The VM used memory per VmId.", + SerializedName = @"vmUsedMemory", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityVMUsedMemory) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityVMUsedMemory VMUsedMemory { get; set; } + + } + /// Host Capacity Data. + internal partial interface IHostCapacityInternal + + { + /// + /// The available amount of GPUs on the host to use after accounting for GPUS used by reservations on the host. + /// + int? AvailableGpuCount { get; set; } + /// + /// The available memory on the host accounting for VM placement size and any host VM reservations. + /// + long? EffectiveAvailableMemoryMbOnHost { get; set; } + /// The GPU type of the VM. + string GpuType { get; set; } + /// The name of the host. + string HostName { get; set; } + /// The numa nodes information for Hpn VMs. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeData[] NumaNodesData { get; set; } + /// The VM used memory per VmId. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityVMUsedMemory VMUsedMemory { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacity.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacity.json.cs new file mode 100644 index 000000000000..042f72dfb467 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacity.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Host Capacity Data. + public partial class HostCapacity + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacity FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new HostCapacity(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal HostCapacity(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_hostName = If( json?.PropertyT("hostName"), out var __jsonHostName) ? (string)__jsonHostName : (string)HostName;} + {_effectiveAvailableMemoryMbOnHost = If( json?.PropertyT("effectiveAvailableMemoryMbOnHost"), out var __jsonEffectiveAvailableMemoryMbOnHost) ? (long?)__jsonEffectiveAvailableMemoryMbOnHost : EffectiveAvailableMemoryMbOnHost;} + {_availableGpuCount = If( json?.PropertyT("availableGpuCount"), out var __jsonAvailableGpuCount) ? (int?)__jsonAvailableGpuCount : AvailableGpuCount;} + {_vMUsedMemory = If( json?.PropertyT("vmUsedMemory"), out var __jsonVMUsedMemory) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.HostCapacityVMUsedMemory.FromJson(__jsonVMUsedMemory) : VMUsedMemory;} + {_gpuType = If( json?.PropertyT("gpuType"), out var __jsonGpuType) ? (string)__jsonGpuType : (string)GpuType;} + {_numaNodesData = If( json?.PropertyT("numaNodesData"), out var __jsonNumaNodesData) ? If( __jsonNumaNodesData as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.INumaNodeData) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NumaNodeData.FromJson(__u) )) ))() : null : NumaNodesData;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._hostName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._hostName.ToString()) : null, "hostName" ,container.Add ); + AddIf( null != this._effectiveAvailableMemoryMbOnHost ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((long)this._effectiveAvailableMemoryMbOnHost) : null, "effectiveAvailableMemoryMbOnHost" ,container.Add ); + AddIf( null != this._availableGpuCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._availableGpuCount) : null, "availableGpuCount" ,container.Add ); + AddIf( null != this._vMUsedMemory ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._vMUsedMemory.ToJson(null,serializationMode) : null, "vmUsedMemory" ,container.Add ); + AddIf( null != (((object)this._gpuType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._gpuType.ToString()) : null, "gpuType" ,container.Add ); + if (null != this._numaNodesData) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._numaNodesData ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("numaNodesData",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacityVMUsedMemory.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacityVMUsedMemory.PowerShell.cs new file mode 100644 index 000000000000..ab8cf27fa8d4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacityVMUsedMemory.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The VM used memory per VmId. + [System.ComponentModel.TypeConverter(typeof(HostCapacityVMUsedMemoryTypeConverter))] + public partial class HostCapacityVMUsedMemory + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IHostCapacityVMUsedMemory DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new HostCapacityVMUsedMemory(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.DataBoxEdge.Models.Api20220301.IHostCapacityVMUsedMemory DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new HostCapacityVMUsedMemory(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.DataBoxEdge.Models.Api20220301.IHostCapacityVMUsedMemory FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal HostCapacityVMUsedMemory(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 HostCapacityVMUsedMemory(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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The VM used memory per VmId. + [System.ComponentModel.TypeConverter(typeof(HostCapacityVMUsedMemoryTypeConverter))] + public partial interface IHostCapacityVMUsedMemory + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacityVMUsedMemory.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacityVMUsedMemory.TypeConverter.cs new file mode 100644 index 000000000000..7cef68bee27a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacityVMUsedMemory.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class HostCapacityVMUsedMemoryTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IHostCapacityVMUsedMemory ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityVMUsedMemory).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return HostCapacityVMUsedMemory.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return HostCapacityVMUsedMemory.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return HostCapacityVMUsedMemory.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/databoxedge/generated/api/Models/Api20220301/HostCapacityVMUsedMemory.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacityVMUsedMemory.cs new file mode 100644 index 000000000000..277ff64ae3ae --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacityVMUsedMemory.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The VM used memory per VmId. + public partial class HostCapacityVMUsedMemory : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityVMUsedMemory, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityVMUsedMemoryInternal + { + + /// Creates an new instance. + public HostCapacityVMUsedMemory() + { + + } + } + /// The VM used memory per VmId. + public partial interface IHostCapacityVMUsedMemory : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray + { + + } + /// The VM used memory per VmId. + internal partial interface IHostCapacityVMUsedMemoryInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacityVMUsedMemory.dictionary.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacityVMUsedMemory.dictionary.cs new file mode 100644 index 000000000000..111366f095f4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacityVMUsedMemory.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + public partial class HostCapacityVMUsedMemory : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMMemory this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMMemory 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.DataBoxEdge.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.DataBoxEdge.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 Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMMemory value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.HostCapacityVMUsedMemory source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacityVMUsedMemory.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacityVMUsedMemory.json.cs new file mode 100644 index 000000000000..ec7599a3500c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/HostCapacityVMUsedMemory.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The VM used memory per VmId. + public partial class HostCapacityVMUsedMemory + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityVMUsedMemory. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityVMUsedMemory. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IHostCapacityVMUsedMemory FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new HostCapacityVMUsedMemory(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + /// + internal HostCapacityVMUsedMemory(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.VMMemory.FromJson(j) ,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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ImageRepositoryCredential.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ImageRepositoryCredential.PowerShell.cs new file mode 100644 index 000000000000..40359252a3fc --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ImageRepositoryCredential.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Image repository credential. + [System.ComponentModel.TypeConverter(typeof(ImageRepositoryCredentialTypeConverter))] + public partial class ImageRepositoryCredential + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ImageRepositoryCredential(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.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ImageRepositoryCredential(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.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ImageRepositoryCredential(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.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).Password = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).Password, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ImageRepositoryUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).ImageRepositoryUrl = (string) content.GetValueForProperty("ImageRepositoryUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).ImageRepositoryUrl, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).PasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("PasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).PasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("PasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).PasswordValue = (string) content.GetValueForProperty("PasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).PasswordValue, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).PasswordEncryptionCertThumbprint = (string) content.GetValueForProperty("PasswordEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).PasswordEncryptionCertThumbprint, 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 ImageRepositoryCredential(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.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).Password = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).Password, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ImageRepositoryUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).ImageRepositoryUrl = (string) content.GetValueForProperty("ImageRepositoryUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).ImageRepositoryUrl, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).PasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("PasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).PasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("PasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).PasswordValue = (string) content.GetValueForProperty("PasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).PasswordValue, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).PasswordEncryptionCertThumbprint = (string) content.GetValueForProperty("PasswordEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)this).PasswordEncryptionCertThumbprint, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Image repository credential. + [System.ComponentModel.TypeConverter(typeof(ImageRepositoryCredentialTypeConverter))] + public partial interface IImageRepositoryCredential + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ImageRepositoryCredential.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ImageRepositoryCredential.TypeConverter.cs new file mode 100644 index 000000000000..5ac243282e9e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ImageRepositoryCredential.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ImageRepositoryCredentialTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ImageRepositoryCredential.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ImageRepositoryCredential.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ImageRepositoryCredential.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/databoxedge/generated/api/Models/Api20220301/ImageRepositoryCredential.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ImageRepositoryCredential.cs new file mode 100644 index 000000000000..20e677b8d9a7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ImageRepositoryCredential.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Image repository credential. + public partial class ImageRepositoryCredential : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal + { + + /// Backing field for property. + private string _imageRepositoryUrl; + + /// Image repository url (e.g.: mcr.microsoft.com). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ImageRepositoryUrl { get => this._imageRepositoryUrl; set => this._imageRepositoryUrl = value; } + + /// Internal Acessors for Password + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal.Password { get => (this._password = this._password ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret()); set { {_password = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret _password; + + /// Repository user password. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Password { get => (this._password = this._password ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret()); set => this._password = value; } + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? PasswordEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)Password).EncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)Password).EncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string PasswordEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)Password).EncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)Password).EncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string PasswordValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)Password).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)Password).Value = value ?? null; } + + /// Backing field for property. + private string _userName; + + /// Repository user name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string UserName { get => this._userName; set => this._userName = value; } + + /// Creates an new instance. + public ImageRepositoryCredential() + { + + } + } + /// Image repository credential. + public partial interface IImageRepositoryCredential : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Image repository url (e.g.: mcr.microsoft.com). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Image repository url (e.g.: mcr.microsoft.com).", + SerializedName = @"imageRepositoryUrl", + PossibleTypes = new [] { typeof(string) })] + string ImageRepositoryUrl { get; set; } + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? PasswordEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string PasswordEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string PasswordValue { get; set; } + /// Repository user name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Repository user name.", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string UserName { get; set; } + + } + /// Image repository credential. + internal partial interface IImageRepositoryCredentialInternal + + { + /// Image repository url (e.g.: mcr.microsoft.com). + string ImageRepositoryUrl { get; set; } + /// Repository user password. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Password { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? PasswordEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string PasswordEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string PasswordValue { get; set; } + /// Repository user name. + string UserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ImageRepositoryCredential.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ImageRepositoryCredential.json.cs new file mode 100644 index 000000000000..4b9ecc42cf63 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ImageRepositoryCredential.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Image repository credential. + public partial class ImageRepositoryCredential + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ImageRepositoryCredential(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ImageRepositoryCredential(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret.FromJson(__jsonPassword) : Password;} + {_imageRepositoryUrl = If( json?.PropertyT("imageRepositoryUrl"), out var __jsonImageRepositoryUrl) ? (string)__jsonImageRepositoryUrl : (string)ImageRepositoryUrl;} + {_userName = If( json?.PropertyT("userName"), out var __jsonUserName) ? (string)__jsonUserName : (string)UserName;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._password ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._password.ToJson(null,serializationMode) : null, "password" ,container.Add ); + AddIf( null != (((object)this._imageRepositoryUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._imageRepositoryUrl.ToString()) : null, "imageRepositoryUrl" ,container.Add ); + AddIf( null != (((object)this._userName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._userName.ToString()) : null, "userName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddon.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddon.PowerShell.cs new file mode 100644 index 000000000000..7d055db786be --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddon.PowerShell.cs @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// IoT Addon. + [System.ComponentModel.TypeConverter(typeof(IoTAddonTypeConverter))] + public partial class IoTAddon + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IIoTAddon DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IoTAddon(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.DataBoxEdge.Models.Api20220301.IIoTAddon DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IoTAddon(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.DataBoxEdge.Models.Api20220301.IIoTAddon FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IoTAddon(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.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTAddonPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType.CreateFrom); + } + if (content.Contains("IoTDeviceDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo) content.GetValueForProperty("IoTDeviceDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo) content.GetValueForProperty("IoTEdgeDeviceDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("HostPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).HostPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType?) content.GetValueForProperty("HostPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).HostPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType.CreateFrom); + } + if (content.Contains("HostPlatformType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).HostPlatformType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType?) content.GetValueForProperty("HostPlatformType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).HostPlatformType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType.CreateFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState.CreateFrom); + } + if (content.Contains("IoTDeviceDetailAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication) content.GetValueForProperty("IoTDeviceDetailAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication) content.GetValueForProperty("IoTEdgeDeviceDetailAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("IoTDeviceDetailDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailDeviceId = (string) content.GetValueForProperty("IoTDeviceDetailDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailDeviceId, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailIoThostHub")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailIoThostHub = (string) content.GetValueForProperty("IoTDeviceDetailIoThostHub",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailIoThostHub, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailIoThostHubId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailIoThostHubId = (string) content.GetValueForProperty("IoTDeviceDetailIoThostHubId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailIoThostHubId, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailDeviceId = (string) content.GetValueForProperty("IoTEdgeDeviceDetailDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailDeviceId, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailIoThostHub")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailIoThostHub = (string) content.GetValueForProperty("IoTEdgeDeviceDetailIoThostHub",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailIoThostHub, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailIoThostHubId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailIoThostHubId = (string) content.GetValueForProperty("IoTEdgeDeviceDetailIoThostHubId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailIoThostHubId, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = (string) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = (string) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint, 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 IoTAddon(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.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTAddonPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType.CreateFrom); + } + if (content.Contains("IoTDeviceDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo) content.GetValueForProperty("IoTDeviceDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo) content.GetValueForProperty("IoTEdgeDeviceDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("HostPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).HostPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType?) content.GetValueForProperty("HostPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).HostPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType.CreateFrom); + } + if (content.Contains("HostPlatformType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).HostPlatformType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType?) content.GetValueForProperty("HostPlatformType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).HostPlatformType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType.CreateFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState.CreateFrom); + } + if (content.Contains("IoTDeviceDetailAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication) content.GetValueForProperty("IoTDeviceDetailAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication) content.GetValueForProperty("IoTEdgeDeviceDetailAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("IoTDeviceDetailDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailDeviceId = (string) content.GetValueForProperty("IoTDeviceDetailDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailDeviceId, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailIoThostHub")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailIoThostHub = (string) content.GetValueForProperty("IoTDeviceDetailIoThostHub",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailIoThostHub, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailIoThostHubId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailIoThostHubId = (string) content.GetValueForProperty("IoTDeviceDetailIoThostHubId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailIoThostHubId, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailDeviceId = (string) content.GetValueForProperty("IoTEdgeDeviceDetailDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailDeviceId, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailIoThostHub")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailIoThostHub = (string) content.GetValueForProperty("IoTEdgeDeviceDetailIoThostHub",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailIoThostHub, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailIoThostHubId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailIoThostHubId = (string) content.GetValueForProperty("IoTEdgeDeviceDetailIoThostHubId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailIoThostHubId, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = (string) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = (string) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// IoT Addon. + [System.ComponentModel.TypeConverter(typeof(IoTAddonTypeConverter))] + public partial interface IIoTAddon + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddon.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddon.TypeConverter.cs new file mode 100644 index 000000000000..9dac27fd2f79 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddon.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IoTAddonTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IIoTAddon ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddon).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IoTAddon.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IoTAddon.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IoTAddon.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/databoxedge/generated/api/Models/Api20220301/IoTAddon.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddon.cs new file mode 100644 index 000000000000..28c85f590635 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddon.cs @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// IoT Addon. + public partial class IoTAddon : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddon, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon __addon = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Addon(); + + /// Host OS supported by the IoT addon. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? HostPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).HostPlatform; } + + /// Platform where the runtime is hosted. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).HostPlatformType; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__addon).Id; } + + /// ID of the IoT device/edge device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailDeviceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetailDeviceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetailDeviceId = value ; } + + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailIoThostHub { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetailIoThostHub; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetailIoThostHub = value ; } + + /// Id for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailIoThostHubId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetailIoThostHubId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetailIoThostHubId = value ?? null; } + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = value ?? null; } + + /// ID of the IoT device/edge device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailDeviceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetailDeviceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetailDeviceId = value ; } + + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailIoThostHub { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetailIoThostHub; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetailIoThostHub = value ; } + + /// Id for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailIoThostHubId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetailIoThostHubId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetailIoThostHubId = value ?? null; } + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = value ?? null; } + + /// Addon type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).Kind = value ; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemData = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__addon).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__addon).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__addon).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__addon).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__addon).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__addon).Type = value; } + + /// Internal Acessors for HostPlatform + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal.HostPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).HostPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).HostPlatform = value; } + + /// Internal Acessors for HostPlatformType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal.HostPlatformType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).HostPlatformType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).HostPlatformType = value; } + + /// Internal Acessors for IoTDeviceDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal.IoTDeviceDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetail = value; } + + /// Internal Acessors for IoTDeviceDetailAuthentication + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal.IoTDeviceDetailAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetailAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetailAuthentication = value; } + + /// Internal Acessors for IoTDeviceDetailsAuthenticationSymmetricKey + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal.IoTDeviceDetailsAuthenticationSymmetricKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKey = value; } + + /// + /// Internal Acessors for IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal.IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString = value; } + + /// Internal Acessors for IoTEdgeDeviceDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal.IoTEdgeDeviceDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetail = value; } + + /// Internal Acessors for IoTEdgeDeviceDetailAuthentication + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal.IoTEdgeDeviceDetailAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetailAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetailAuthentication = value; } + + /// Internal Acessors for IoTEdgeDeviceDetailsAuthenticationSymmetricKey + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal.IoTEdgeDeviceDetailsAuthenticationSymmetricKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKey = value; } + + /// + /// Internal Acessors for IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal.IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTAddonProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonInternal.Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).Version = value; } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__addon).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonProperties _property; + + /// Properties specific to IOT addon. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTAddonProperties()); set => this._property = value; } + + /// Addon Provisioning State + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).ProvisioningState; } + + /// Metadata pertaining to creation and last modification of Addon + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal)__addon).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__addon).Type; } + + /// Version of IoT running on the appliance. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)Property).Version; } + + /// Creates an new instance. + public IoTAddon() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__addon), __addon); + await eventListener.AssertObjectIsValid(nameof(__addon), __addon); + } + } + /// IoT Addon. + public partial interface IIoTAddon : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon + { + /// Host OS supported by the IoT addon. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Host OS supported by the IoT addon.", + SerializedName = @"hostPlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? HostPlatform { get; } + /// Platform where the runtime is hosted. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Platform where the runtime is hosted.", + SerializedName = @"hostPlatformType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get; } + /// ID of the IoT device/edge device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"ID of the IoT device/edge device.", + SerializedName = @"deviceId", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailDeviceId { get; set; } + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Host name for the IoT hub associated to the device.", + SerializedName = @"ioTHostHub", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailIoThostHub { get; set; } + /// Id for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id for the IoT hub associated to the device.", + SerializedName = @"ioTHostHubId", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailIoThostHubId { get; set; } + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get; set; } + /// ID of the IoT device/edge device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"ID of the IoT device/edge device.", + SerializedName = @"deviceId", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailDeviceId { get; set; } + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Host name for the IoT hub associated to the device.", + SerializedName = @"ioTHostHub", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailIoThostHub { get; set; } + /// Id for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id for the IoT hub associated to the device.", + SerializedName = @"ioTHostHubId", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailIoThostHubId { get; set; } + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get; set; } + /// Addon Provisioning State + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Addon Provisioning State", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState? ProvisioningState { get; } + /// Version of IoT running on the appliance. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Version of IoT running on the appliance.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; } + + } + /// IoT Addon. + internal partial interface IIoTAddonInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddonInternal + { + /// Host OS supported by the IoT addon. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? HostPlatform { get; set; } + /// Platform where the runtime is hosted. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get; set; } + /// IoT device metadata to which appliance needs to be connected. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo IoTDeviceDetail { get; set; } + /// Encrypted IoT device/IoT edge device connection string. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication IoTDeviceDetailAuthentication { get; set; } + /// ID of the IoT device/edge device. + string IoTDeviceDetailDeviceId { get; set; } + /// Host name for the IoT hub associated to the device. + string IoTDeviceDetailIoThostHub { get; set; } + /// Id for the IoT hub associated to the device. + string IoTDeviceDetailIoThostHubId { get; set; } + /// Symmetric key for authentication. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey IoTDeviceDetailsAuthenticationSymmetricKey { get; set; } + /// Connection string based on the symmetric key. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get; set; } + /// IoT edge device to which the IoT Addon needs to be configured. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo IoTEdgeDeviceDetail { get; set; } + /// Encrypted IoT device/IoT edge device connection string. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication IoTEdgeDeviceDetailAuthentication { get; set; } + /// ID of the IoT device/edge device. + string IoTEdgeDeviceDetailDeviceId { get; set; } + /// Host name for the IoT hub associated to the device. + string IoTEdgeDeviceDetailIoThostHub { get; set; } + /// Id for the IoT hub associated to the device. + string IoTEdgeDeviceDetailIoThostHubId { get; set; } + /// Symmetric key for authentication. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey IoTEdgeDeviceDetailsAuthenticationSymmetricKey { get; set; } + /// Connection string based on the symmetric key. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get; set; } + /// Properties specific to IOT addon. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonProperties Property { get; set; } + /// Addon Provisioning State + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState? ProvisioningState { get; set; } + /// Version of IoT running on the appliance. + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddon.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddon.json.cs new file mode 100644 index 000000000000..5c6863086b11 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddon.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// IoT Addon. + public partial class IoTAddon + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddon. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddon. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddon FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new IoTAddon(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal IoTAddon(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __addon = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Addon(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTAddonProperties.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __addon?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/IoTAddonProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddonProperties.PowerShell.cs new file mode 100644 index 000000000000..3009a271dd6c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddonProperties.PowerShell.cs @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// IoT addon properties. + [System.ComponentModel.TypeConverter(typeof(IoTAddonPropertiesTypeConverter))] + public partial class IoTAddonProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IIoTAddonProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IoTAddonProperties(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.DataBoxEdge.Models.Api20220301.IIoTAddonProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IoTAddonProperties(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.DataBoxEdge.Models.Api20220301.IIoTAddonProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IoTAddonProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IoTDeviceDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo) content.GetValueForProperty("IoTDeviceDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo) content.GetValueForProperty("IoTEdgeDeviceDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("HostPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).HostPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType?) content.GetValueForProperty("HostPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).HostPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType.CreateFrom); + } + if (content.Contains("HostPlatformType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).HostPlatformType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType?) content.GetValueForProperty("HostPlatformType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).HostPlatformType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType.CreateFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState.CreateFrom); + } + if (content.Contains("IoTDeviceDetailAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication) content.GetValueForProperty("IoTDeviceDetailAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication) content.GetValueForProperty("IoTEdgeDeviceDetailAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("IoTDeviceDetailDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailDeviceId = (string) content.GetValueForProperty("IoTDeviceDetailDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailDeviceId, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailIoThostHub")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailIoThostHub = (string) content.GetValueForProperty("IoTDeviceDetailIoThostHub",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailIoThostHub, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailIoThostHubId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailIoThostHubId = (string) content.GetValueForProperty("IoTDeviceDetailIoThostHubId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailIoThostHubId, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailDeviceId = (string) content.GetValueForProperty("IoTEdgeDeviceDetailDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailDeviceId, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailIoThostHub")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailIoThostHub = (string) content.GetValueForProperty("IoTEdgeDeviceDetailIoThostHub",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailIoThostHub, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailIoThostHubId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailIoThostHubId = (string) content.GetValueForProperty("IoTEdgeDeviceDetailIoThostHubId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailIoThostHubId, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = (string) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = (string) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint, 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 IoTAddonProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IoTDeviceDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo) content.GetValueForProperty("IoTDeviceDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo) content.GetValueForProperty("IoTEdgeDeviceDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("HostPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).HostPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType?) content.GetValueForProperty("HostPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).HostPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType.CreateFrom); + } + if (content.Contains("HostPlatformType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).HostPlatformType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType?) content.GetValueForProperty("HostPlatformType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).HostPlatformType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType.CreateFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState.CreateFrom); + } + if (content.Contains("IoTDeviceDetailAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication) content.GetValueForProperty("IoTDeviceDetailAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication) content.GetValueForProperty("IoTEdgeDeviceDetailAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("IoTDeviceDetailDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailDeviceId = (string) content.GetValueForProperty("IoTDeviceDetailDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailDeviceId, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailIoThostHub")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailIoThostHub = (string) content.GetValueForProperty("IoTDeviceDetailIoThostHub",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailIoThostHub, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailIoThostHubId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailIoThostHubId = (string) content.GetValueForProperty("IoTDeviceDetailIoThostHubId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailIoThostHubId, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailDeviceId = (string) content.GetValueForProperty("IoTEdgeDeviceDetailDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailDeviceId, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailIoThostHub")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailIoThostHub = (string) content.GetValueForProperty("IoTEdgeDeviceDetailIoThostHub",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailIoThostHub, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailIoThostHubId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailIoThostHubId = (string) content.GetValueForProperty("IoTEdgeDeviceDetailIoThostHubId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailIoThostHubId, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = (string) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = (string) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// IoT addon properties. + [System.ComponentModel.TypeConverter(typeof(IoTAddonPropertiesTypeConverter))] + public partial interface IIoTAddonProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddonProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddonProperties.TypeConverter.cs new file mode 100644 index 000000000000..c2eee1cebdfd --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddonProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IoTAddonPropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IIoTAddonProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IoTAddonProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IoTAddonProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IoTAddonProperties.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/databoxedge/generated/api/Models/Api20220301/IoTAddonProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddonProperties.cs new file mode 100644 index 000000000000..4b60c032f340 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddonProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// IoT addon properties. + public partial class IoTAddonProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? _hostPlatform; + + /// Host OS supported by the IoT addon. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? HostPlatform { get => this._hostPlatform; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? _hostPlatformType; + + /// Platform where the runtime is hosted. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get => this._hostPlatformType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo _ioTDeviceDetail; + + /// IoT device metadata to which appliance needs to be connected. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo IoTDeviceDetail { get => (this._ioTDeviceDetail = this._ioTDeviceDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfo()); set => this._ioTDeviceDetail = value; } + + /// ID of the IoT device/edge device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailDeviceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).DeviceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).DeviceId = value ; } + + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailIoThostHub { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).IoTHostHub; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).IoTHostHub = value ; } + + /// Id for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailIoThostHubId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).IoTHostHubId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).IoTHostHubId = value ?? null; } + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).ConnectionStringEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).ConnectionStringEncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).ConnectionStringEncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).ConnectionStringEncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).ConnectionStringValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).ConnectionStringValue = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo _ioTEdgeDeviceDetail; + + /// IoT edge device to which the IoT Addon needs to be configured. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo IoTEdgeDeviceDetail { get => (this._ioTEdgeDeviceDetail = this._ioTEdgeDeviceDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfo()); set => this._ioTEdgeDeviceDetail = value; } + + /// ID of the IoT device/edge device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailDeviceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).DeviceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).DeviceId = value ; } + + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailIoThostHub { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).IoTHostHub; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).IoTHostHub = value ; } + + /// Id for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailIoThostHubId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).IoTHostHubId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).IoTHostHubId = value ?? null; } + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).ConnectionStringEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).ConnectionStringEncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).ConnectionStringEncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).ConnectionStringEncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).ConnectionStringValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).ConnectionStringValue = value ?? null; } + + /// Internal Acessors for HostPlatform + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal.HostPlatform { get => this._hostPlatform; set { {_hostPlatform = value;} } } + + /// Internal Acessors for HostPlatformType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal.HostPlatformType { get => this._hostPlatformType; set { {_hostPlatformType = value;} } } + + /// Internal Acessors for IoTDeviceDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal.IoTDeviceDetail { get => (this._ioTDeviceDetail = this._ioTDeviceDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfo()); set { {_ioTDeviceDetail = value;} } } + + /// Internal Acessors for IoTDeviceDetailAuthentication + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal.IoTDeviceDetailAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).Authentication = value; } + + /// Internal Acessors for IoTDeviceDetailsAuthenticationSymmetricKey + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal.IoTDeviceDetailsAuthenticationSymmetricKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).AuthenticationSymmetricKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).AuthenticationSymmetricKey = value; } + + /// + /// Internal Acessors for IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal.IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).SymmetricKeyConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).SymmetricKeyConnectionString = value; } + + /// Internal Acessors for IoTEdgeDeviceDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal.IoTEdgeDeviceDetail { get => (this._ioTEdgeDeviceDetail = this._ioTEdgeDeviceDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfo()); set { {_ioTEdgeDeviceDetail = value;} } } + + /// Internal Acessors for IoTEdgeDeviceDetailAuthentication + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal.IoTEdgeDeviceDetailAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).Authentication = value; } + + /// Internal Acessors for IoTEdgeDeviceDetailsAuthenticationSymmetricKey + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal.IoTEdgeDeviceDetailsAuthenticationSymmetricKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).AuthenticationSymmetricKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).AuthenticationSymmetricKey = value; } + + /// + /// Internal Acessors for IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal.IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).SymmetricKeyConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).SymmetricKeyConnectionString = value; } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonPropertiesInternal.Version { get => this._version; set { {_version = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState? _provisioningState; + + /// Addon Provisioning State + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState? ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private string _version; + + /// Version of IoT running on the appliance. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Version { get => this._version; } + + /// Creates an new instance. + public IoTAddonProperties() + { + + } + } + /// IoT addon properties. + public partial interface IIoTAddonProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Host OS supported by the IoT addon. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Host OS supported by the IoT addon.", + SerializedName = @"hostPlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? HostPlatform { get; } + /// Platform where the runtime is hosted. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Platform where the runtime is hosted.", + SerializedName = @"hostPlatformType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get; } + /// ID of the IoT device/edge device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"ID of the IoT device/edge device.", + SerializedName = @"deviceId", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailDeviceId { get; set; } + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Host name for the IoT hub associated to the device.", + SerializedName = @"ioTHostHub", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailIoThostHub { get; set; } + /// Id for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id for the IoT hub associated to the device.", + SerializedName = @"ioTHostHubId", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailIoThostHubId { get; set; } + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get; set; } + /// ID of the IoT device/edge device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"ID of the IoT device/edge device.", + SerializedName = @"deviceId", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailDeviceId { get; set; } + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Host name for the IoT hub associated to the device.", + SerializedName = @"ioTHostHub", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailIoThostHub { get; set; } + /// Id for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id for the IoT hub associated to the device.", + SerializedName = @"ioTHostHubId", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailIoThostHubId { get; set; } + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get; set; } + /// Addon Provisioning State + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Addon Provisioning State", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState? ProvisioningState { get; } + /// Version of IoT running on the appliance. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Version of IoT running on the appliance.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; } + + } + /// IoT addon properties. + internal partial interface IIoTAddonPropertiesInternal + + { + /// Host OS supported by the IoT addon. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? HostPlatform { get; set; } + /// Platform where the runtime is hosted. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get; set; } + /// IoT device metadata to which appliance needs to be connected. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo IoTDeviceDetail { get; set; } + /// Encrypted IoT device/IoT edge device connection string. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication IoTDeviceDetailAuthentication { get; set; } + /// ID of the IoT device/edge device. + string IoTDeviceDetailDeviceId { get; set; } + /// Host name for the IoT hub associated to the device. + string IoTDeviceDetailIoThostHub { get; set; } + /// Id for the IoT hub associated to the device. + string IoTDeviceDetailIoThostHubId { get; set; } + /// Symmetric key for authentication. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey IoTDeviceDetailsAuthenticationSymmetricKey { get; set; } + /// Connection string based on the symmetric key. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get; set; } + /// IoT edge device to which the IoT Addon needs to be configured. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo IoTEdgeDeviceDetail { get; set; } + /// Encrypted IoT device/IoT edge device connection string. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication IoTEdgeDeviceDetailAuthentication { get; set; } + /// ID of the IoT device/edge device. + string IoTEdgeDeviceDetailDeviceId { get; set; } + /// Host name for the IoT hub associated to the device. + string IoTEdgeDeviceDetailIoThostHub { get; set; } + /// Id for the IoT hub associated to the device. + string IoTEdgeDeviceDetailIoThostHubId { get; set; } + /// Symmetric key for authentication. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey IoTEdgeDeviceDetailsAuthenticationSymmetricKey { get; set; } + /// Connection string based on the symmetric key. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get; set; } + /// Addon Provisioning State + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState? ProvisioningState { get; set; } + /// Version of IoT running on the appliance. + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddonProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddonProperties.json.cs new file mode 100644 index 000000000000..2ba9f558f065 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTAddonProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// IoT addon properties. + public partial class IoTAddonProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTAddonProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new IoTAddonProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal IoTAddonProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_ioTDeviceDetail = If( json?.PropertyT("ioTDeviceDetails"), out var __jsonIoTDeviceDetails) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfo.FromJson(__jsonIoTDeviceDetails) : IoTDeviceDetail;} + {_ioTEdgeDeviceDetail = If( json?.PropertyT("ioTEdgeDeviceDetails"), out var __jsonIoTEdgeDeviceDetails) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfo.FromJson(__jsonIoTEdgeDeviceDetails) : IoTEdgeDeviceDetail;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + {_hostPlatform = If( json?.PropertyT("hostPlatform"), out var __jsonHostPlatform) ? (string)__jsonHostPlatform : (string)HostPlatform;} + {_hostPlatformType = If( json?.PropertyT("hostPlatformType"), out var __jsonHostPlatformType) ? (string)__jsonHostPlatformType : (string)HostPlatformType;} + {_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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._ioTDeviceDetail ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._ioTDeviceDetail.ToJson(null,serializationMode) : null, "ioTDeviceDetails" ,container.Add ); + AddIf( null != this._ioTEdgeDeviceDetail ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._ioTEdgeDeviceDetail.ToJson(null,serializationMode) : null, "ioTEdgeDeviceDetails" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._hostPlatform)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._hostPlatform.ToString()) : null, "hostPlatform" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._hostPlatformType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._hostPlatformType.ToString()) : null, "hostPlatformType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/IoTDeviceInfo.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTDeviceInfo.PowerShell.cs new file mode 100644 index 000000000000..e4f8f9f0bc5d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTDeviceInfo.PowerShell.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Metadata of IoT device/IoT Edge device to be configured. + [System.ComponentModel.TypeConverter(typeof(IoTDeviceInfoTypeConverter))] + public partial class IoTDeviceInfo + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IoTDeviceInfo(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.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IoTDeviceInfo(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.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IoTDeviceInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Authentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).Authentication = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication) content.GetValueForProperty("Authentication",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).Authentication, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("DeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).DeviceId = (string) content.GetValueForProperty("DeviceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).DeviceId, global::System.Convert.ToString); + } + if (content.Contains("IoTHostHub")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).IoTHostHub = (string) content.GetValueForProperty("IoTHostHub",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).IoTHostHub, global::System.Convert.ToString); + } + if (content.Contains("IoTHostHubId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).IoTHostHubId = (string) content.GetValueForProperty("IoTHostHubId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).IoTHostHubId, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationSymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).AuthenticationSymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("AuthenticationSymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).AuthenticationSymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("SymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).SymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("SymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).SymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).ConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("ConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).ConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("ConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).ConnectionStringValue = (string) content.GetValueForProperty("ConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).ConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("ConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).ConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("ConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).ConnectionStringEncryptionCertThumbprint, 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 IoTDeviceInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Authentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).Authentication = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication) content.GetValueForProperty("Authentication",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).Authentication, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("DeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).DeviceId = (string) content.GetValueForProperty("DeviceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).DeviceId, global::System.Convert.ToString); + } + if (content.Contains("IoTHostHub")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).IoTHostHub = (string) content.GetValueForProperty("IoTHostHub",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).IoTHostHub, global::System.Convert.ToString); + } + if (content.Contains("IoTHostHubId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).IoTHostHubId = (string) content.GetValueForProperty("IoTHostHubId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).IoTHostHubId, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationSymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).AuthenticationSymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("AuthenticationSymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).AuthenticationSymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("SymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).SymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("SymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).SymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).ConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("ConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).ConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("ConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).ConnectionStringValue = (string) content.GetValueForProperty("ConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).ConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("ConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).ConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("ConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)this).ConnectionStringEncryptionCertThumbprint, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Metadata of IoT device/IoT Edge device to be configured. + [System.ComponentModel.TypeConverter(typeof(IoTDeviceInfoTypeConverter))] + public partial interface IIoTDeviceInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTDeviceInfo.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTDeviceInfo.TypeConverter.cs new file mode 100644 index 000000000000..37e7e8c52f46 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTDeviceInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IoTDeviceInfoTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IoTDeviceInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IoTDeviceInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IoTDeviceInfo.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/databoxedge/generated/api/Models/Api20220301/IoTDeviceInfo.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTDeviceInfo.cs new file mode 100644 index 000000000000..b2b68ef463b2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTDeviceInfo.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Metadata of IoT device/IoT Edge device to be configured. + public partial class IoTDeviceInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication _authentication; + + /// Encrypted IoT device/IoT edge device connection string. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication Authentication { get => (this._authentication = this._authentication ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Authentication()); set => this._authentication = value; } + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? ConnectionStringEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)Authentication).ConnectionStringEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)Authentication).ConnectionStringEncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ConnectionStringEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)Authentication).ConnectionStringEncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)Authentication).ConnectionStringEncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ConnectionStringValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)Authentication).ConnectionStringValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)Authentication).ConnectionStringValue = value ?? null; } + + /// Backing field for property. + private string _deviceId; + + /// ID of the IoT device/edge device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string DeviceId { get => this._deviceId; set => this._deviceId = value; } + + /// Backing field for property. + private string _ioTHostHub; + + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string IoTHostHub { get => this._ioTHostHub; set => this._ioTHostHub = value; } + + /// Backing field for property. + private string _ioTHostHubId; + + /// Id for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string IoTHostHubId { get => this._ioTHostHubId; set => this._ioTHostHubId = value; } + + /// Internal Acessors for Authentication + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal.Authentication { get => (this._authentication = this._authentication ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Authentication()); set { {_authentication = value;} } } + + /// Internal Acessors for AuthenticationSymmetricKey + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal.AuthenticationSymmetricKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)Authentication).SymmetricKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)Authentication).SymmetricKey = value; } + + /// Internal Acessors for SymmetricKeyConnectionString + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal.SymmetricKeyConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)Authentication).SymmetricKeyConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthenticationInternal)Authentication).SymmetricKeyConnectionString = value; } + + /// Creates an new instance. + public IoTDeviceInfo() + { + + } + } + /// Metadata of IoT device/IoT Edge device to be configured. + public partial interface IIoTDeviceInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? ConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string ConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string ConnectionStringValue { get; set; } + /// ID of the IoT device/edge device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"ID of the IoT device/edge device.", + SerializedName = @"deviceId", + PossibleTypes = new [] { typeof(string) })] + string DeviceId { get; set; } + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Host name for the IoT hub associated to the device.", + SerializedName = @"ioTHostHub", + PossibleTypes = new [] { typeof(string) })] + string IoTHostHub { get; set; } + /// Id for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id for the IoT hub associated to the device.", + SerializedName = @"ioTHostHubId", + PossibleTypes = new [] { typeof(string) })] + string IoTHostHubId { get; set; } + + } + /// Metadata of IoT device/IoT Edge device to be configured. + internal partial interface IIoTDeviceInfoInternal + + { + /// Encrypted IoT device/IoT edge device connection string. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication Authentication { get; set; } + /// Symmetric key for authentication. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey AuthenticationSymmetricKey { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? ConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string ConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string ConnectionStringValue { get; set; } + /// ID of the IoT device/edge device. + string DeviceId { get; set; } + /// Host name for the IoT hub associated to the device. + string IoTHostHub { get; set; } + /// Id for the IoT hub associated to the device. + string IoTHostHubId { get; set; } + /// Connection string based on the symmetric key. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret SymmetricKeyConnectionString { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTDeviceInfo.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTDeviceInfo.json.cs new file mode 100644 index 000000000000..37bd40eb1a3e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTDeviceInfo.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Metadata of IoT device/IoT Edge device to be configured. + public partial class IoTDeviceInfo + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new IoTDeviceInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal IoTDeviceInfo(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_authentication = If( json?.PropertyT("authentication"), out var __jsonAuthentication) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Authentication.FromJson(__jsonAuthentication) : Authentication;} + {_deviceId = If( json?.PropertyT("deviceId"), out var __jsonDeviceId) ? (string)__jsonDeviceId : (string)DeviceId;} + {_ioTHostHub = If( json?.PropertyT("ioTHostHub"), out var __jsonIoTHostHub) ? (string)__jsonIoTHostHub : (string)IoTHostHub;} + {_ioTHostHubId = If( json?.PropertyT("ioTHostHubId"), out var __jsonIoTHostHubId) ? (string)__jsonIoTHostHubId : (string)IoTHostHubId;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._authentication ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._authentication.ToJson(null,serializationMode) : null, "authentication" ,container.Add ); + AddIf( null != (((object)this._deviceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._deviceId.ToString()) : null, "deviceId" ,container.Add ); + AddIf( null != (((object)this._ioTHostHub)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._ioTHostHub.ToString()) : null, "ioTHostHub" ,container.Add ); + AddIf( null != (((object)this._ioTHostHubId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._ioTHostHubId.ToString()) : null, "ioTHostHubId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTEdgeAgentInfo.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTEdgeAgentInfo.PowerShell.cs new file mode 100644 index 000000000000..c5323e6d28c9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTEdgeAgentInfo.PowerShell.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// IoT edge agent details is optional, this will be used for download system Agent module while bootstrapping IoT Role if + /// specified. + /// + [System.ComponentModel.TypeConverter(typeof(IoTEdgeAgentInfoTypeConverter))] + public partial class IoTEdgeAgentInfo + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IoTEdgeAgentInfo(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.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IoTEdgeAgentInfo(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.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IoTEdgeAgentInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ImageRepository")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageRepository = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential) content.GetValueForProperty("ImageRepository",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageRepository, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ImageRepositoryCredentialTypeConverter.ConvertFrom); + } + if (content.Contains("ImageName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageName = (string) content.GetValueForProperty("ImageName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageName, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).Tag = (string) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).Tag, global::System.Convert.ToString); + } + if (content.Contains("ImageRepositoryPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageRepositoryPassword = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("ImageRepositoryPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageRepositoryPassword, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ImageRepositoryUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageRepositoryUrl = (string) content.GetValueForProperty("ImageRepositoryUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageRepositoryUrl, global::System.Convert.ToString); + } + if (content.Contains("ImageRepositoryUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageRepositoryUserName = (string) content.GetValueForProperty("ImageRepositoryUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageRepositoryUserName, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).PasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("PasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).PasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("PasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).PasswordValue = (string) content.GetValueForProperty("PasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).PasswordValue, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).PasswordEncryptionCertThumbprint = (string) content.GetValueForProperty("PasswordEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).PasswordEncryptionCertThumbprint, 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 IoTEdgeAgentInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ImageRepository")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageRepository = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential) content.GetValueForProperty("ImageRepository",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageRepository, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ImageRepositoryCredentialTypeConverter.ConvertFrom); + } + if (content.Contains("ImageName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageName = (string) content.GetValueForProperty("ImageName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageName, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).Tag = (string) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).Tag, global::System.Convert.ToString); + } + if (content.Contains("ImageRepositoryPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageRepositoryPassword = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("ImageRepositoryPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageRepositoryPassword, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ImageRepositoryUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageRepositoryUrl = (string) content.GetValueForProperty("ImageRepositoryUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageRepositoryUrl, global::System.Convert.ToString); + } + if (content.Contains("ImageRepositoryUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageRepositoryUserName = (string) content.GetValueForProperty("ImageRepositoryUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).ImageRepositoryUserName, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).PasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("PasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).PasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("PasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).PasswordValue = (string) content.GetValueForProperty("PasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).PasswordValue, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).PasswordEncryptionCertThumbprint = (string) content.GetValueForProperty("PasswordEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)this).PasswordEncryptionCertThumbprint, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// IoT edge agent details is optional, this will be used for download system Agent module while bootstrapping IoT Role if + /// specified. + [System.ComponentModel.TypeConverter(typeof(IoTEdgeAgentInfoTypeConverter))] + public partial interface IIoTEdgeAgentInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTEdgeAgentInfo.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTEdgeAgentInfo.TypeConverter.cs new file mode 100644 index 000000000000..0fc1bf3ed5c8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTEdgeAgentInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IoTEdgeAgentInfoTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IoTEdgeAgentInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IoTEdgeAgentInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IoTEdgeAgentInfo.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/databoxedge/generated/api/Models/Api20220301/IoTEdgeAgentInfo.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTEdgeAgentInfo.cs new file mode 100644 index 000000000000..04e2fd01bc4c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTEdgeAgentInfo.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// IoT edge agent details is optional, this will be used for download system Agent module while bootstrapping IoT Role if + /// specified. + /// + public partial class IoTEdgeAgentInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal + { + + /// Backing field for property. + private string _imageName; + + /// Name of the IoT edge agent image. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ImageName { get => this._imageName; set => this._imageName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential _imageRepository; + + /// Image repository details. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential ImageRepository { get => (this._imageRepository = this._imageRepository ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ImageRepositoryCredential()); set => this._imageRepository = value; } + + /// Image repository url (e.g.: mcr.microsoft.com). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ImageRepositoryUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)ImageRepository).ImageRepositoryUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)ImageRepository).ImageRepositoryUrl = value ?? null; } + + /// Repository user name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ImageRepositoryUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)ImageRepository).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)ImageRepository).UserName = value ?? null; } + + /// Internal Acessors for ImageRepository + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal.ImageRepository { get => (this._imageRepository = this._imageRepository ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ImageRepositoryCredential()); set { {_imageRepository = value;} } } + + /// Internal Acessors for ImageRepositoryPassword + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal.ImageRepositoryPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)ImageRepository).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)ImageRepository).Password = value; } + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? PasswordEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)ImageRepository).PasswordEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)ImageRepository).PasswordEncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string PasswordEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)ImageRepository).PasswordEncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)ImageRepository).PasswordEncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string PasswordValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)ImageRepository).PasswordValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredentialInternal)ImageRepository).PasswordValue = value ?? null; } + + /// Backing field for property. + private string _tag; + + /// Image Tag. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Tag { get => this._tag; set => this._tag = value; } + + /// Creates an new instance. + public IoTEdgeAgentInfo() + { + + } + } + /// IoT edge agent details is optional, this will be used for download system Agent module while bootstrapping IoT Role if + /// specified. + public partial interface IIoTEdgeAgentInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Name of the IoT edge agent image. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the IoT edge agent image.", + SerializedName = @"imageName", + PossibleTypes = new [] { typeof(string) })] + string ImageName { get; set; } + /// Image repository url (e.g.: mcr.microsoft.com). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Image repository url (e.g.: mcr.microsoft.com).", + SerializedName = @"imageRepositoryUrl", + PossibleTypes = new [] { typeof(string) })] + string ImageRepositoryUrl { get; set; } + /// Repository user name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Repository user name.", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string ImageRepositoryUserName { get; set; } + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? PasswordEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string PasswordEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string PasswordValue { get; set; } + /// Image Tag. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Image Tag.", + SerializedName = @"tag", + PossibleTypes = new [] { typeof(string) })] + string Tag { get; set; } + + } + /// IoT edge agent details is optional, this will be used for download system Agent module while bootstrapping IoT Role if + /// specified. + internal partial interface IIoTEdgeAgentInfoInternal + + { + /// Name of the IoT edge agent image. + string ImageName { get; set; } + /// Image repository details. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential ImageRepository { get; set; } + /// Repository user password. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret ImageRepositoryPassword { get; set; } + /// Image repository url (e.g.: mcr.microsoft.com). + string ImageRepositoryUrl { get; set; } + /// Repository user name. + string ImageRepositoryUserName { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? PasswordEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string PasswordEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string PasswordValue { get; set; } + /// Image Tag. + string Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTEdgeAgentInfo.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTEdgeAgentInfo.json.cs new file mode 100644 index 000000000000..9275c1768c9d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTEdgeAgentInfo.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// IoT edge agent details is optional, this will be used for download system Agent module while bootstrapping IoT Role if + /// specified. + /// + public partial class IoTEdgeAgentInfo + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new IoTEdgeAgentInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal IoTEdgeAgentInfo(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_imageRepository = If( json?.PropertyT("imageRepository"), out var __jsonImageRepository) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ImageRepositoryCredential.FromJson(__jsonImageRepository) : ImageRepository;} + {_imageName = If( json?.PropertyT("imageName"), out var __jsonImageName) ? (string)__jsonImageName : (string)ImageName;} + {_tag = If( json?.PropertyT("tag"), out var __jsonTag) ? (string)__jsonTag : (string)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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._imageRepository ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._imageRepository.ToJson(null,serializationMode) : null, "imageRepository" ,container.Add ); + AddIf( null != (((object)this._imageName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._imageName.ToString()) : null, "imageName" ,container.Add ); + AddIf( null != (((object)this._tag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._tag.ToString()) : null, "tag" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRole.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRole.PowerShell.cs new file mode 100644 index 000000000000..f3d48403df4b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRole.PowerShell.cs @@ -0,0 +1,526 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Compute role. + [System.ComponentModel.TypeConverter(typeof(IoTRoleTypeConverter))] + public partial class IoTRole + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IIoTRole DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IoTRole(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.DataBoxEdge.Models.Api20220301.IIoTRole DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IoTRole(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.DataBoxEdge.Models.Api20220301.IIoTRole FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IoTRole(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.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTRolePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes.CreateFrom); + } + if (content.Contains("ComputeResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ComputeResource = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResource) content.GetValueForProperty("ComputeResource",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ComputeResource, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ComputeResourceTypeConverter.ConvertFrom); + } + if (content.Contains("RoleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).RoleStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) content.GetValueForProperty("RoleStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).RoleStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("IoTDeviceDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo) content.GetValueForProperty("IoTDeviceDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo) content.GetValueForProperty("IoTEdgeDeviceDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeAgentInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeAgentInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfo) content.GetValueForProperty("IoTEdgeAgentInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeAgentInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTEdgeAgentInfoTypeConverter.ConvertFrom); + } + if (content.Contains("HostPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).HostPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType) content.GetValueForProperty("HostPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).HostPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType.CreateFrom); + } + if (content.Contains("ShareMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ShareMapping = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[]) content.GetValueForProperty("ShareMapping",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ShareMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMapTypeConverter.ConvertFrom)); + } + if (content.Contains("HostPlatformType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).HostPlatformType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType?) content.GetValueForProperty("HostPlatformType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).HostPlatformType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType.CreateFrom); + } + if (content.Contains("IoTDeviceDetailAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication) content.GetValueForProperty("IoTDeviceDetailAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication) content.GetValueForProperty("IoTEdgeDeviceDetailAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeAgentInfoImageName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeAgentInfoImageName = (string) content.GetValueForProperty("IoTEdgeAgentInfoImageName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeAgentInfoImageName, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeAgentInfoTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeAgentInfoTag = (string) content.GetValueForProperty("IoTEdgeAgentInfoTag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeAgentInfoTag, global::System.Convert.ToString); + } + if (content.Contains("ComputeResourceProcessorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ComputeResourceProcessorCount = (int) content.GetValueForProperty("ComputeResourceProcessorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ComputeResourceProcessorCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IoTDeviceDetailDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailDeviceId = (string) content.GetValueForProperty("IoTDeviceDetailDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailDeviceId, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailIoThostHub")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailIoThostHub = (string) content.GetValueForProperty("IoTDeviceDetailIoThostHub",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailIoThostHub, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailIoThostHubId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailIoThostHubId = (string) content.GetValueForProperty("IoTDeviceDetailIoThostHubId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailIoThostHubId, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailDeviceId = (string) content.GetValueForProperty("IoTEdgeDeviceDetailDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailDeviceId, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailIoThostHub")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailIoThostHub = (string) content.GetValueForProperty("IoTEdgeDeviceDetailIoThostHub",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailIoThostHub, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailIoThostHubId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailIoThostHubId = (string) content.GetValueForProperty("IoTEdgeDeviceDetailIoThostHubId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailIoThostHubId, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeAgentInfoImageRepository")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeAgentInfoImageRepository = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential) content.GetValueForProperty("IoTEdgeAgentInfoImageRepository",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeAgentInfoImageRepository, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ImageRepositoryCredentialTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeResourceMemoryInGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ComputeResourceMemoryInGb = (long) content.GetValueForProperty("ComputeResourceMemoryInGb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ComputeResourceMemoryInGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ImageRepositoryPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ImageRepositoryPassword = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("ImageRepositoryPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ImageRepositoryPassword, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ImageRepositoryUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ImageRepositoryUrl = (string) content.GetValueForProperty("ImageRepositoryUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ImageRepositoryUrl, global::System.Convert.ToString); + } + if (content.Contains("ImageRepositoryUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ImageRepositoryUserName = (string) content.GetValueForProperty("ImageRepositoryUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ImageRepositoryUserName, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).PasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("PasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).PasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("PasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).PasswordValue = (string) content.GetValueForProperty("PasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).PasswordValue, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).PasswordEncryptionCertThumbprint = (string) content.GetValueForProperty("PasswordEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).PasswordEncryptionCertThumbprint, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = (string) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = (string) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint, 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 IoTRole(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.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTRolePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes.CreateFrom); + } + if (content.Contains("ComputeResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ComputeResource = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResource) content.GetValueForProperty("ComputeResource",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ComputeResource, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ComputeResourceTypeConverter.ConvertFrom); + } + if (content.Contains("RoleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).RoleStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) content.GetValueForProperty("RoleStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).RoleStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("IoTDeviceDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo) content.GetValueForProperty("IoTDeviceDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo) content.GetValueForProperty("IoTEdgeDeviceDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeAgentInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeAgentInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfo) content.GetValueForProperty("IoTEdgeAgentInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeAgentInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTEdgeAgentInfoTypeConverter.ConvertFrom); + } + if (content.Contains("HostPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).HostPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType) content.GetValueForProperty("HostPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).HostPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType.CreateFrom); + } + if (content.Contains("ShareMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ShareMapping = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[]) content.GetValueForProperty("ShareMapping",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ShareMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMapTypeConverter.ConvertFrom)); + } + if (content.Contains("HostPlatformType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).HostPlatformType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType?) content.GetValueForProperty("HostPlatformType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).HostPlatformType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType.CreateFrom); + } + if (content.Contains("IoTDeviceDetailAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication) content.GetValueForProperty("IoTDeviceDetailAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication) content.GetValueForProperty("IoTEdgeDeviceDetailAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeAgentInfoImageName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeAgentInfoImageName = (string) content.GetValueForProperty("IoTEdgeAgentInfoImageName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeAgentInfoImageName, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeAgentInfoTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeAgentInfoTag = (string) content.GetValueForProperty("IoTEdgeAgentInfoTag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeAgentInfoTag, global::System.Convert.ToString); + } + if (content.Contains("ComputeResourceProcessorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ComputeResourceProcessorCount = (int) content.GetValueForProperty("ComputeResourceProcessorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ComputeResourceProcessorCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IoTDeviceDetailDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailDeviceId = (string) content.GetValueForProperty("IoTDeviceDetailDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailDeviceId, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailIoThostHub")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailIoThostHub = (string) content.GetValueForProperty("IoTDeviceDetailIoThostHub",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailIoThostHub, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailIoThostHubId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailIoThostHubId = (string) content.GetValueForProperty("IoTDeviceDetailIoThostHubId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailIoThostHubId, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailDeviceId = (string) content.GetValueForProperty("IoTEdgeDeviceDetailDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailDeviceId, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailIoThostHub")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailIoThostHub = (string) content.GetValueForProperty("IoTEdgeDeviceDetailIoThostHub",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailIoThostHub, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailIoThostHubId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailIoThostHubId = (string) content.GetValueForProperty("IoTEdgeDeviceDetailIoThostHubId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailIoThostHubId, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeAgentInfoImageRepository")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeAgentInfoImageRepository = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential) content.GetValueForProperty("IoTEdgeAgentInfoImageRepository",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeAgentInfoImageRepository, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ImageRepositoryCredentialTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeResourceMemoryInGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ComputeResourceMemoryInGb = (long) content.GetValueForProperty("ComputeResourceMemoryInGb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ComputeResourceMemoryInGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ImageRepositoryPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ImageRepositoryPassword = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("ImageRepositoryPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ImageRepositoryPassword, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ImageRepositoryUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ImageRepositoryUrl = (string) content.GetValueForProperty("ImageRepositoryUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ImageRepositoryUrl, global::System.Convert.ToString); + } + if (content.Contains("ImageRepositoryUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ImageRepositoryUserName = (string) content.GetValueForProperty("ImageRepositoryUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).ImageRepositoryUserName, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).PasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("PasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).PasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("PasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).PasswordValue = (string) content.GetValueForProperty("PasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).PasswordValue, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).PasswordEncryptionCertThumbprint = (string) content.GetValueForProperty("PasswordEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).PasswordEncryptionCertThumbprint, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = (string) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = (string) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Compute role. + [System.ComponentModel.TypeConverter(typeof(IoTRoleTypeConverter))] + public partial interface IIoTRole + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRole.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRole.TypeConverter.cs new file mode 100644 index 000000000000..315b7dcae69d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRole.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IoTRoleTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IIoTRole ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRole).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IoTRole.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IoTRole.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IoTRole.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/databoxedge/generated/api/Models/Api20220301/IoTRole.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRole.cs new file mode 100644 index 000000000000..c3a4fab4c775 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRole.cs @@ -0,0 +1,556 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Compute role. + public partial class IoTRole : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRole, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole __role = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Role(); + + /// Memory in GB + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public long? ComputeResourceMemoryInGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).ComputeResourceMemoryInGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).ComputeResourceMemoryInGb = value ?? default(long); } + + /// Processor count + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? ComputeResourceProcessorCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).ComputeResourceProcessorCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).ComputeResourceProcessorCount = value ?? default(int); } + + /// Host OS supported by the IoT role. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? HostPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).HostPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).HostPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType)""); } + + /// Platform where the Iot runtime is hosted. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).HostPlatformType; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Id; } + + /// Image repository url (e.g.: mcr.microsoft.com). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ImageRepositoryUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).ImageRepositoryUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).ImageRepositoryUrl = value ?? null; } + + /// Repository user name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ImageRepositoryUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).ImageRepositoryUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).ImageRepositoryUserName = value ?? null; } + + /// ID of the IoT device/edge device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailDeviceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetailDeviceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetailDeviceId = value ?? null; } + + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailIoThostHub { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetailIoThostHub; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetailIoThostHub = value ?? null; } + + /// Id for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailIoThostHubId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetailIoThostHubId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetailIoThostHubId = value ?? null; } + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = value ?? null; } + + /// Name of the IoT edge agent image. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeAgentInfoImageName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeAgentInfoImageName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeAgentInfoImageName = value ?? null; } + + /// Image Tag. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeAgentInfoTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeAgentInfoTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeAgentInfoTag = value ?? null; } + + /// ID of the IoT device/edge device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailDeviceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetailDeviceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetailDeviceId = value ?? null; } + + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailIoThostHub { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetailIoThostHub; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetailIoThostHub = value ?? null; } + + /// Id for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailIoThostHubId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetailIoThostHubId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetailIoThostHubId = value ?? null; } + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = value ?? null; } + + /// Role type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).Kind = value ; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Type = value; } + + /// Internal Acessors for ComputeResource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResource Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal.ComputeResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).ComputeResource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).ComputeResource = value; } + + /// Internal Acessors for HostPlatformType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal.HostPlatformType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).HostPlatformType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).HostPlatformType = value; } + + /// Internal Acessors for ImageRepositoryPassword + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal.ImageRepositoryPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).ImageRepositoryPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).ImageRepositoryPassword = value; } + + /// Internal Acessors for IoTDeviceDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal.IoTDeviceDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetail = value; } + + /// Internal Acessors for IoTDeviceDetailAuthentication + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal.IoTDeviceDetailAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetailAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetailAuthentication = value; } + + /// Internal Acessors for IoTDeviceDetailsAuthenticationSymmetricKey + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal.IoTDeviceDetailsAuthenticationSymmetricKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKey = value; } + + /// + /// Internal Acessors for IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal.IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString = value; } + + /// Internal Acessors for IoTEdgeAgentInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal.IoTEdgeAgentInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeAgentInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeAgentInfo = value; } + + /// Internal Acessors for IoTEdgeAgentInfoImageRepository + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal.IoTEdgeAgentInfoImageRepository { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeAgentInfoImageRepository; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeAgentInfoImageRepository = value; } + + /// Internal Acessors for IoTEdgeDeviceDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal.IoTEdgeDeviceDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetail = value; } + + /// Internal Acessors for IoTEdgeDeviceDetailAuthentication + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal.IoTEdgeDeviceDetailAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetailAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetailAuthentication = value; } + + /// Internal Acessors for IoTEdgeDeviceDetailsAuthenticationSymmetricKey + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal.IoTEdgeDeviceDetailsAuthenticationSymmetricKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKey = value; } + + /// + /// Internal Acessors for IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal.IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTRoleProperties()); set { {_property = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemData = value; } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Name; } + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? PasswordEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).PasswordEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).PasswordEncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string PasswordEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).PasswordEncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).PasswordEncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string PasswordValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).PasswordValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).PasswordValue = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleProperties _property; + + /// Properties specific to IoT role. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTRoleProperties()); set => this._property = value; } + + /// Role status. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? RoleStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).RoleStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).RoleStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus)""); } + + /// Mount points of shares in role(s). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] ShareMapping { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).ShareMapping; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)Property).ShareMapping = value ?? null /* arrayOf */; } + + /// Metadata pertaining to creation and last modification of Role + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Type; } + + /// Creates an new instance. + public IoTRole() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__role), __role); + await eventListener.AssertObjectIsValid(nameof(__role), __role); + } + } + /// Compute role. + public partial interface IIoTRole : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole + { + /// Memory in GB + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Memory in GB", + SerializedName = @"memoryInGB", + PossibleTypes = new [] { typeof(long) })] + long? ComputeResourceMemoryInGb { get; set; } + /// Processor count + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Processor count", + SerializedName = @"processorCount", + PossibleTypes = new [] { typeof(int) })] + int? ComputeResourceProcessorCount { get; set; } + /// Host OS supported by the IoT role. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Host OS supported by the IoT role.", + SerializedName = @"hostPlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? HostPlatform { get; set; } + /// Platform where the Iot runtime is hosted. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Platform where the Iot runtime is hosted.", + SerializedName = @"hostPlatformType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get; } + /// Image repository url (e.g.: mcr.microsoft.com). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Image repository url (e.g.: mcr.microsoft.com).", + SerializedName = @"imageRepositoryUrl", + PossibleTypes = new [] { typeof(string) })] + string ImageRepositoryUrl { get; set; } + /// Repository user name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Repository user name.", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string ImageRepositoryUserName { get; set; } + /// ID of the IoT device/edge device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the IoT device/edge device.", + SerializedName = @"deviceId", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailDeviceId { get; set; } + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Host name for the IoT hub associated to the device.", + SerializedName = @"ioTHostHub", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailIoThostHub { get; set; } + /// Id for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id for the IoT hub associated to the device.", + SerializedName = @"ioTHostHubId", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailIoThostHubId { get; set; } + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get; set; } + /// Name of the IoT edge agent image. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the IoT edge agent image.", + SerializedName = @"imageName", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeAgentInfoImageName { get; set; } + /// Image Tag. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Image Tag.", + SerializedName = @"tag", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeAgentInfoTag { get; set; } + /// ID of the IoT device/edge device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the IoT device/edge device.", + SerializedName = @"deviceId", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailDeviceId { get; set; } + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Host name for the IoT hub associated to the device.", + SerializedName = @"ioTHostHub", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailIoThostHub { get; set; } + /// Id for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id for the IoT hub associated to the device.", + SerializedName = @"ioTHostHubId", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailIoThostHubId { get; set; } + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get; set; } + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? PasswordEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string PasswordEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string PasswordValue { get; set; } + /// Role status. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Role status.", + SerializedName = @"roleStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? RoleStatus { get; set; } + /// Mount points of shares in role(s). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mount points of shares in role(s).", + SerializedName = @"shareMappings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] ShareMapping { get; set; } + + } + /// Compute role. + internal partial interface IIoTRoleInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal + { + /// Resource allocation + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResource ComputeResource { get; set; } + /// Memory in GB + long? ComputeResourceMemoryInGb { get; set; } + /// Processor count + int? ComputeResourceProcessorCount { get; set; } + /// Host OS supported by the IoT role. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? HostPlatform { get; set; } + /// Platform where the Iot runtime is hosted. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get; set; } + /// Repository user password. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret ImageRepositoryPassword { get; set; } + /// Image repository url (e.g.: mcr.microsoft.com). + string ImageRepositoryUrl { get; set; } + /// Repository user name. + string ImageRepositoryUserName { get; set; } + /// IoT device metadata to which data box edge device needs to be connected. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo IoTDeviceDetail { get; set; } + /// Encrypted IoT device/IoT edge device connection string. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication IoTDeviceDetailAuthentication { get; set; } + /// ID of the IoT device/edge device. + string IoTDeviceDetailDeviceId { get; set; } + /// Host name for the IoT hub associated to the device. + string IoTDeviceDetailIoThostHub { get; set; } + /// Id for the IoT hub associated to the device. + string IoTDeviceDetailIoThostHubId { get; set; } + /// Symmetric key for authentication. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey IoTDeviceDetailsAuthenticationSymmetricKey { get; set; } + /// Connection string based on the symmetric key. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get; set; } + /// Iot edge agent details to download the agent and bootstrap iot runtime. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfo IoTEdgeAgentInfo { get; set; } + /// Name of the IoT edge agent image. + string IoTEdgeAgentInfoImageName { get; set; } + /// Image repository details. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential IoTEdgeAgentInfoImageRepository { get; set; } + /// Image Tag. + string IoTEdgeAgentInfoTag { get; set; } + /// IoT edge device to which the IoT role needs to be configured. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo IoTEdgeDeviceDetail { get; set; } + /// Encrypted IoT device/IoT edge device connection string. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication IoTEdgeDeviceDetailAuthentication { get; set; } + /// ID of the IoT device/edge device. + string IoTEdgeDeviceDetailDeviceId { get; set; } + /// Host name for the IoT hub associated to the device. + string IoTEdgeDeviceDetailIoThostHub { get; set; } + /// Id for the IoT hub associated to the device. + string IoTEdgeDeviceDetailIoThostHubId { get; set; } + /// Symmetric key for authentication. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey IoTEdgeDeviceDetailsAuthenticationSymmetricKey { get; set; } + /// Connection string based on the symmetric key. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? PasswordEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string PasswordEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string PasswordValue { get; set; } + /// Properties specific to IoT role. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleProperties Property { get; set; } + /// Role status. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? RoleStatus { get; set; } + /// Mount points of shares in role(s). + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] ShareMapping { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRole.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRole.json.cs new file mode 100644 index 000000000000..74132cf737b3 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRole.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Compute role. + public partial class IoTRole + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRole. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRole. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRole FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new IoTRole(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal IoTRole(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __role = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Role(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTRoleProperties.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __role?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/IoTRoleProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRoleProperties.PowerShell.cs new file mode 100644 index 000000000000..877e4b97356b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRoleProperties.PowerShell.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// IoT role properties. + [System.ComponentModel.TypeConverter(typeof(IoTRolePropertiesTypeConverter))] + public partial class IoTRoleProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IIoTRoleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IoTRoleProperties(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.DataBoxEdge.Models.Api20220301.IIoTRoleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IoTRoleProperties(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.DataBoxEdge.Models.Api20220301.IIoTRoleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IoTRoleProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IoTDeviceDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo) content.GetValueForProperty("IoTDeviceDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo) content.GetValueForProperty("IoTEdgeDeviceDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeAgentInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeAgentInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfo) content.GetValueForProperty("IoTEdgeAgentInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeAgentInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTEdgeAgentInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ComputeResource = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResource) content.GetValueForProperty("ComputeResource",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ComputeResource, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ComputeResourceTypeConverter.ConvertFrom); + } + if (content.Contains("HostPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).HostPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType) content.GetValueForProperty("HostPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).HostPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType.CreateFrom); + } + if (content.Contains("ShareMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ShareMapping = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[]) content.GetValueForProperty("ShareMapping",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ShareMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMapTypeConverter.ConvertFrom)); + } + if (content.Contains("HostPlatformType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).HostPlatformType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType?) content.GetValueForProperty("HostPlatformType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).HostPlatformType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType.CreateFrom); + } + if (content.Contains("RoleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).RoleStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) content.GetValueForProperty("RoleStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).RoleStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("IoTDeviceDetailAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication) content.GetValueForProperty("IoTDeviceDetailAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication) content.GetValueForProperty("IoTEdgeDeviceDetailAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeAgentInfoImageName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeAgentInfoImageName = (string) content.GetValueForProperty("IoTEdgeAgentInfoImageName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeAgentInfoImageName, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeAgentInfoTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeAgentInfoTag = (string) content.GetValueForProperty("IoTEdgeAgentInfoTag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeAgentInfoTag, global::System.Convert.ToString); + } + if (content.Contains("ComputeResourceProcessorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ComputeResourceProcessorCount = (int) content.GetValueForProperty("ComputeResourceProcessorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ComputeResourceProcessorCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IoTDeviceDetailDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailDeviceId = (string) content.GetValueForProperty("IoTDeviceDetailDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailDeviceId, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailIoThostHub")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailIoThostHub = (string) content.GetValueForProperty("IoTDeviceDetailIoThostHub",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailIoThostHub, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailIoThostHubId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailIoThostHubId = (string) content.GetValueForProperty("IoTDeviceDetailIoThostHubId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailIoThostHubId, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailDeviceId = (string) content.GetValueForProperty("IoTEdgeDeviceDetailDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailDeviceId, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailIoThostHub")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailIoThostHub = (string) content.GetValueForProperty("IoTEdgeDeviceDetailIoThostHub",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailIoThostHub, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailIoThostHubId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailIoThostHubId = (string) content.GetValueForProperty("IoTEdgeDeviceDetailIoThostHubId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailIoThostHubId, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeAgentInfoImageRepository")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeAgentInfoImageRepository = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential) content.GetValueForProperty("IoTEdgeAgentInfoImageRepository",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeAgentInfoImageRepository, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ImageRepositoryCredentialTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeResourceMemoryInGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ComputeResourceMemoryInGb = (long) content.GetValueForProperty("ComputeResourceMemoryInGb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ComputeResourceMemoryInGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ImageRepositoryPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ImageRepositoryPassword = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("ImageRepositoryPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ImageRepositoryPassword, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ImageRepositoryUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ImageRepositoryUrl = (string) content.GetValueForProperty("ImageRepositoryUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ImageRepositoryUrl, global::System.Convert.ToString); + } + if (content.Contains("ImageRepositoryUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ImageRepositoryUserName = (string) content.GetValueForProperty("ImageRepositoryUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ImageRepositoryUserName, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).PasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("PasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).PasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("PasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).PasswordValue = (string) content.GetValueForProperty("PasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).PasswordValue, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).PasswordEncryptionCertThumbprint = (string) content.GetValueForProperty("PasswordEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).PasswordEncryptionCertThumbprint, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = (string) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = (string) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint, 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 IoTRoleProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IoTDeviceDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo) content.GetValueForProperty("IoTDeviceDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo) content.GetValueForProperty("IoTEdgeDeviceDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeAgentInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeAgentInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfo) content.GetValueForProperty("IoTEdgeAgentInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeAgentInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTEdgeAgentInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ComputeResource = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResource) content.GetValueForProperty("ComputeResource",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ComputeResource, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ComputeResourceTypeConverter.ConvertFrom); + } + if (content.Contains("HostPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).HostPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType) content.GetValueForProperty("HostPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).HostPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType.CreateFrom); + } + if (content.Contains("ShareMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ShareMapping = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[]) content.GetValueForProperty("ShareMapping",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ShareMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMapTypeConverter.ConvertFrom)); + } + if (content.Contains("HostPlatformType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).HostPlatformType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType?) content.GetValueForProperty("HostPlatformType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).HostPlatformType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType.CreateFrom); + } + if (content.Contains("RoleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).RoleStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) content.GetValueForProperty("RoleStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).RoleStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("IoTDeviceDetailAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication) content.GetValueForProperty("IoTDeviceDetailAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication) content.GetValueForProperty("IoTEdgeDeviceDetailAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailAuthentication, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeAgentInfoImageName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeAgentInfoImageName = (string) content.GetValueForProperty("IoTEdgeAgentInfoImageName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeAgentInfoImageName, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeAgentInfoTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeAgentInfoTag = (string) content.GetValueForProperty("IoTEdgeAgentInfoTag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeAgentInfoTag, global::System.Convert.ToString); + } + if (content.Contains("ComputeResourceProcessorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ComputeResourceProcessorCount = (int) content.GetValueForProperty("ComputeResourceProcessorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ComputeResourceProcessorCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IoTDeviceDetailDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailDeviceId = (string) content.GetValueForProperty("IoTDeviceDetailDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailDeviceId, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailIoThostHub")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailIoThostHub = (string) content.GetValueForProperty("IoTDeviceDetailIoThostHub",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailIoThostHub, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailIoThostHubId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailIoThostHubId = (string) content.GetValueForProperty("IoTDeviceDetailIoThostHubId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailIoThostHubId, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailDeviceId = (string) content.GetValueForProperty("IoTEdgeDeviceDetailDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailDeviceId, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailIoThostHub")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailIoThostHub = (string) content.GetValueForProperty("IoTEdgeDeviceDetailIoThostHub",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailIoThostHub, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailIoThostHubId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailIoThostHubId = (string) content.GetValueForProperty("IoTEdgeDeviceDetailIoThostHubId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailIoThostHubId, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SymmetricKeyTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeAgentInfoImageRepository")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeAgentInfoImageRepository = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential) content.GetValueForProperty("IoTEdgeAgentInfoImageRepository",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeAgentInfoImageRepository, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ImageRepositoryCredentialTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeResourceMemoryInGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ComputeResourceMemoryInGb = (long) content.GetValueForProperty("ComputeResourceMemoryInGb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ComputeResourceMemoryInGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ImageRepositoryPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ImageRepositoryPassword = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("ImageRepositoryPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ImageRepositoryPassword, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ImageRepositoryUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ImageRepositoryUrl = (string) content.GetValueForProperty("ImageRepositoryUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ImageRepositoryUrl, global::System.Convert.ToString); + } + if (content.Contains("ImageRepositoryUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ImageRepositoryUserName = (string) content.GetValueForProperty("ImageRepositoryUserName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).ImageRepositoryUserName, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).PasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("PasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).PasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("PasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).PasswordValue = (string) content.GetValueForProperty("PasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).PasswordValue, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).PasswordEncryptionCertThumbprint = (string) content.GetValueForProperty("PasswordEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).PasswordEncryptionCertThumbprint, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = (string) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue = (string) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal)this).IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// IoT role properties. + [System.ComponentModel.TypeConverter(typeof(IoTRolePropertiesTypeConverter))] + public partial interface IIoTRoleProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRoleProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRoleProperties.TypeConverter.cs new file mode 100644 index 000000000000..b4bed583c491 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRoleProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IoTRolePropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IIoTRoleProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IoTRoleProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IoTRoleProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IoTRoleProperties.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/databoxedge/generated/api/Models/Api20220301/IoTRoleProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRoleProperties.cs new file mode 100644 index 000000000000..8efec5df4768 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRoleProperties.cs @@ -0,0 +1,509 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// IoT role properties. + public partial class IoTRoleProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResource _computeResource; + + /// Resource allocation + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResource ComputeResource { get => (this._computeResource = this._computeResource ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ComputeResource()); set => this._computeResource = value; } + + /// Memory in GB + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public long? ComputeResourceMemoryInGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResourceInternal)ComputeResource).MemoryInGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResourceInternal)ComputeResource).MemoryInGb = value ?? default(long); } + + /// Processor count + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? ComputeResourceProcessorCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResourceInternal)ComputeResource).ProcessorCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResourceInternal)ComputeResource).ProcessorCount = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType _hostPlatform; + + /// Host OS supported by the IoT role. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType HostPlatform { get => this._hostPlatform; set => this._hostPlatform = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? _hostPlatformType; + + /// Platform where the Iot runtime is hosted. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get => this._hostPlatformType; } + + /// Image repository url (e.g.: mcr.microsoft.com). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ImageRepositoryUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)IoTEdgeAgentInfo).ImageRepositoryUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)IoTEdgeAgentInfo).ImageRepositoryUrl = value ?? null; } + + /// Repository user name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ImageRepositoryUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)IoTEdgeAgentInfo).ImageRepositoryUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)IoTEdgeAgentInfo).ImageRepositoryUserName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo _ioTDeviceDetail; + + /// IoT device metadata to which data box edge device needs to be connected. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo IoTDeviceDetail { get => (this._ioTDeviceDetail = this._ioTDeviceDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfo()); set => this._ioTDeviceDetail = value; } + + /// ID of the IoT device/edge device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailDeviceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).DeviceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).DeviceId = value ; } + + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailIoThostHub { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).IoTHostHub; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).IoTHostHub = value ; } + + /// Id for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailIoThostHubId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).IoTHostHubId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).IoTHostHubId = value ?? null; } + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).ConnectionStringEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).ConnectionStringEncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).ConnectionStringEncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).ConnectionStringEncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).ConnectionStringValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).ConnectionStringValue = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfo _ioTEdgeAgentInfo; + + /// Iot edge agent details to download the agent and bootstrap iot runtime. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfo IoTEdgeAgentInfo { get => (this._ioTEdgeAgentInfo = this._ioTEdgeAgentInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTEdgeAgentInfo()); set => this._ioTEdgeAgentInfo = value; } + + /// Name of the IoT edge agent image. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeAgentInfoImageName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)IoTEdgeAgentInfo).ImageName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)IoTEdgeAgentInfo).ImageName = value ?? null; } + + /// Image Tag. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeAgentInfoTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)IoTEdgeAgentInfo).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)IoTEdgeAgentInfo).Tag = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo _ioTEdgeDeviceDetail; + + /// IoT edge device to which the IoT role needs to be configured. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo IoTEdgeDeviceDetail { get => (this._ioTEdgeDeviceDetail = this._ioTEdgeDeviceDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfo()); set => this._ioTEdgeDeviceDetail = value; } + + /// ID of the IoT device/edge device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailDeviceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).DeviceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).DeviceId = value ; } + + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailIoThostHub { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).IoTHostHub; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).IoTHostHub = value ; } + + /// Id for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailIoThostHubId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).IoTHostHubId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).IoTHostHubId = value ?? null; } + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).ConnectionStringEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).ConnectionStringEncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).ConnectionStringEncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).ConnectionStringEncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).ConnectionStringValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).ConnectionStringValue = value ?? null; } + + /// Internal Acessors for ComputeResource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResource Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal.ComputeResource { get => (this._computeResource = this._computeResource ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ComputeResource()); set { {_computeResource = value;} } } + + /// Internal Acessors for HostPlatformType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal.HostPlatformType { get => this._hostPlatformType; set { {_hostPlatformType = value;} } } + + /// Internal Acessors for ImageRepositoryPassword + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal.ImageRepositoryPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)IoTEdgeAgentInfo).ImageRepositoryPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)IoTEdgeAgentInfo).ImageRepositoryPassword = value; } + + /// Internal Acessors for IoTDeviceDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal.IoTDeviceDetail { get => (this._ioTDeviceDetail = this._ioTDeviceDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfo()); set { {_ioTDeviceDetail = value;} } } + + /// Internal Acessors for IoTDeviceDetailAuthentication + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal.IoTDeviceDetailAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).Authentication = value; } + + /// Internal Acessors for IoTDeviceDetailsAuthenticationSymmetricKey + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal.IoTDeviceDetailsAuthenticationSymmetricKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).AuthenticationSymmetricKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).AuthenticationSymmetricKey = value; } + + /// + /// Internal Acessors for IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal.IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).SymmetricKeyConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTDeviceDetail).SymmetricKeyConnectionString = value; } + + /// Internal Acessors for IoTEdgeAgentInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal.IoTEdgeAgentInfo { get => (this._ioTEdgeAgentInfo = this._ioTEdgeAgentInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTEdgeAgentInfo()); set { {_ioTEdgeAgentInfo = value;} } } + + /// Internal Acessors for IoTEdgeAgentInfoImageRepository + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal.IoTEdgeAgentInfoImageRepository { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)IoTEdgeAgentInfo).ImageRepository; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)IoTEdgeAgentInfo).ImageRepository = value; } + + /// Internal Acessors for IoTEdgeDeviceDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal.IoTEdgeDeviceDetail { get => (this._ioTEdgeDeviceDetail = this._ioTEdgeDeviceDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfo()); set { {_ioTEdgeDeviceDetail = value;} } } + + /// Internal Acessors for IoTEdgeDeviceDetailAuthentication + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal.IoTEdgeDeviceDetailAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).Authentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).Authentication = value; } + + /// Internal Acessors for IoTEdgeDeviceDetailsAuthenticationSymmetricKey + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal.IoTEdgeDeviceDetailsAuthenticationSymmetricKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).AuthenticationSymmetricKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).AuthenticationSymmetricKey = value; } + + /// + /// Internal Acessors for IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRolePropertiesInternal.IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).SymmetricKeyConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfoInternal)IoTEdgeDeviceDetail).SymmetricKeyConnectionString = value; } + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? PasswordEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)IoTEdgeAgentInfo).PasswordEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)IoTEdgeAgentInfo).PasswordEncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string PasswordEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)IoTEdgeAgentInfo).PasswordEncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)IoTEdgeAgentInfo).PasswordEncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string PasswordValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)IoTEdgeAgentInfo).PasswordValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfoInternal)IoTEdgeAgentInfo).PasswordValue = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus _roleStatus; + + /// Role status. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus RoleStatus { get => this._roleStatus; set => this._roleStatus = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] _shareMapping; + + /// Mount points of shares in role(s). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] ShareMapping { get => this._shareMapping; set => this._shareMapping = value; } + + /// Creates an new instance. + public IoTRoleProperties() + { + + } + } + /// IoT role properties. + public partial interface IIoTRoleProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Memory in GB + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Memory in GB", + SerializedName = @"memoryInGB", + PossibleTypes = new [] { typeof(long) })] + long? ComputeResourceMemoryInGb { get; set; } + /// Processor count + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Processor count", + SerializedName = @"processorCount", + PossibleTypes = new [] { typeof(int) })] + int? ComputeResourceProcessorCount { get; set; } + /// Host OS supported by the IoT role. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Host OS supported by the IoT role.", + SerializedName = @"hostPlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType HostPlatform { get; set; } + /// Platform where the Iot runtime is hosted. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Platform where the Iot runtime is hosted.", + SerializedName = @"hostPlatformType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get; } + /// Image repository url (e.g.: mcr.microsoft.com). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Image repository url (e.g.: mcr.microsoft.com).", + SerializedName = @"imageRepositoryUrl", + PossibleTypes = new [] { typeof(string) })] + string ImageRepositoryUrl { get; set; } + /// Repository user name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Repository user name.", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string ImageRepositoryUserName { get; set; } + /// ID of the IoT device/edge device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"ID of the IoT device/edge device.", + SerializedName = @"deviceId", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailDeviceId { get; set; } + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Host name for the IoT hub associated to the device.", + SerializedName = @"ioTHostHub", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailIoThostHub { get; set; } + /// Id for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id for the IoT hub associated to the device.", + SerializedName = @"ioTHostHubId", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailIoThostHubId { get; set; } + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get; set; } + /// Name of the IoT edge agent image. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the IoT edge agent image.", + SerializedName = @"imageName", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeAgentInfoImageName { get; set; } + /// Image Tag. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Image Tag.", + SerializedName = @"tag", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeAgentInfoTag { get; set; } + /// ID of the IoT device/edge device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"ID of the IoT device/edge device.", + SerializedName = @"deviceId", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailDeviceId { get; set; } + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Host name for the IoT hub associated to the device.", + SerializedName = @"ioTHostHub", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailIoThostHub { get; set; } + /// Id for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id for the IoT hub associated to the device.", + SerializedName = @"ioTHostHubId", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailIoThostHubId { get; set; } + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get; set; } + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? PasswordEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string PasswordEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string PasswordValue { get; set; } + /// Role status. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Role status.", + SerializedName = @"roleStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus RoleStatus { get; set; } + /// Mount points of shares in role(s). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mount points of shares in role(s).", + SerializedName = @"shareMappings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] ShareMapping { get; set; } + + } + /// IoT role properties. + internal partial interface IIoTRolePropertiesInternal + + { + /// Resource allocation + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IComputeResource ComputeResource { get; set; } + /// Memory in GB + long? ComputeResourceMemoryInGb { get; set; } + /// Processor count + int? ComputeResourceProcessorCount { get; set; } + /// Host OS supported by the IoT role. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType HostPlatform { get; set; } + /// Platform where the Iot runtime is hosted. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get; set; } + /// Repository user password. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret ImageRepositoryPassword { get; set; } + /// Image repository url (e.g.: mcr.microsoft.com). + string ImageRepositoryUrl { get; set; } + /// Repository user name. + string ImageRepositoryUserName { get; set; } + /// IoT device metadata to which data box edge device needs to be connected. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo IoTDeviceDetail { get; set; } + /// Encrypted IoT device/IoT edge device connection string. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication IoTDeviceDetailAuthentication { get; set; } + /// ID of the IoT device/edge device. + string IoTDeviceDetailDeviceId { get; set; } + /// Host name for the IoT hub associated to the device. + string IoTDeviceDetailIoThostHub { get; set; } + /// Id for the IoT hub associated to the device. + string IoTDeviceDetailIoThostHubId { get; set; } + /// Symmetric key for authentication. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey IoTDeviceDetailsAuthenticationSymmetricKey { get; set; } + /// Connection string based on the symmetric key. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret IoTDeviceDetailsAuthenticationSymmetricKeyConnectionString { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string IoTDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get; set; } + /// Iot edge agent details to download the agent and bootstrap iot runtime. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTEdgeAgentInfo IoTEdgeAgentInfo { get; set; } + /// Name of the IoT edge agent image. + string IoTEdgeAgentInfoImageName { get; set; } + /// Image repository details. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IImageRepositoryCredential IoTEdgeAgentInfoImageRepository { get; set; } + /// Image Tag. + string IoTEdgeAgentInfoTag { get; set; } + /// IoT edge device to which the IoT role needs to be configured. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTDeviceInfo IoTEdgeDeviceDetail { get; set; } + /// Encrypted IoT device/IoT edge device connection string. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAuthentication IoTEdgeDeviceDetailAuthentication { get; set; } + /// ID of the IoT device/edge device. + string IoTEdgeDeviceDetailDeviceId { get; set; } + /// Host name for the IoT hub associated to the device. + string IoTEdgeDeviceDetailIoThostHub { get; set; } + /// Id for the IoT hub associated to the device. + string IoTEdgeDeviceDetailIoThostHubId { get; set; } + /// Symmetric key for authentication. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey IoTEdgeDeviceDetailsAuthenticationSymmetricKey { get; set; } + /// Connection string based on the symmetric key. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionString { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string IoTEdgeDeviceDetailsAuthenticationSymmetricKeyConnectionStringValue { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? PasswordEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string PasswordEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string PasswordValue { get; set; } + /// Role status. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus RoleStatus { get; set; } + /// Mount points of shares in role(s). + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] ShareMapping { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRoleProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRoleProperties.json.cs new file mode 100644 index 000000000000..d5b2d97294fb --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/IoTRoleProperties.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// IoT role properties. + public partial class IoTRoleProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIoTRoleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new IoTRoleProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal IoTRoleProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_ioTDeviceDetail = If( json?.PropertyT("ioTDeviceDetails"), out var __jsonIoTDeviceDetails) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfo.FromJson(__jsonIoTDeviceDetails) : IoTDeviceDetail;} + {_ioTEdgeDeviceDetail = If( json?.PropertyT("ioTEdgeDeviceDetails"), out var __jsonIoTEdgeDeviceDetails) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTDeviceInfo.FromJson(__jsonIoTEdgeDeviceDetails) : IoTEdgeDeviceDetail;} + {_ioTEdgeAgentInfo = If( json?.PropertyT("ioTEdgeAgentInfo"), out var __jsonIoTEdgeAgentInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IoTEdgeAgentInfo.FromJson(__jsonIoTEdgeAgentInfo) : IoTEdgeAgentInfo;} + {_computeResource = If( json?.PropertyT("computeResource"), out var __jsonComputeResource) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ComputeResource.FromJson(__jsonComputeResource) : ComputeResource;} + {_hostPlatform = If( json?.PropertyT("hostPlatform"), out var __jsonHostPlatform) ? (string)__jsonHostPlatform : (string)HostPlatform;} + {_shareMapping = If( json?.PropertyT("shareMappings"), out var __jsonShareMappings) ? If( __jsonShareMappings as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IMountPointMap) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMap.FromJson(__u) )) ))() : null : ShareMapping;} + {_hostPlatformType = If( json?.PropertyT("hostPlatformType"), out var __jsonHostPlatformType) ? (string)__jsonHostPlatformType : (string)HostPlatformType;} + {_roleStatus = If( json?.PropertyT("roleStatus"), out var __jsonRoleStatus) ? (string)__jsonRoleStatus : (string)RoleStatus;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._ioTDeviceDetail ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._ioTDeviceDetail.ToJson(null,serializationMode) : null, "ioTDeviceDetails" ,container.Add ); + AddIf( null != this._ioTEdgeDeviceDetail ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._ioTEdgeDeviceDetail.ToJson(null,serializationMode) : null, "ioTEdgeDeviceDetails" ,container.Add ); + AddIf( null != this._ioTEdgeAgentInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._ioTEdgeAgentInfo.ToJson(null,serializationMode) : null, "ioTEdgeAgentInfo" ,container.Add ); + AddIf( null != this._computeResource ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._computeResource.ToJson(null,serializationMode) : null, "computeResource" ,container.Add ); + AddIf( null != (((object)this._hostPlatform)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._hostPlatform.ToString()) : null, "hostPlatform" ,container.Add ); + if (null != this._shareMapping) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._shareMapping ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("shareMappings",__w); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._hostPlatformType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._hostPlatformType.ToString()) : null, "hostPlatformType" ,container.Add ); + } + AddIf( null != (((object)this._roleStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._roleStatus.ToString()) : null, "roleStatus" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv4Config.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv4Config.PowerShell.cs new file mode 100644 index 000000000000..fa566449afb9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv4Config.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Details related to the IPv4 address configuration. + [System.ComponentModel.TypeConverter(typeof(Ipv4ConfigTypeConverter))] + public partial class Ipv4Config + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IIpv4Config DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Ipv4Config(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.DataBoxEdge.Models.Api20220301.IIpv4Config DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Ipv4Config(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.DataBoxEdge.Models.Api20220301.IIpv4Config FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Ipv4Config(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.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)this).IPAddress = (string) content.GetValueForProperty("IPAddress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)this).IPAddress, global::System.Convert.ToString); + } + if (content.Contains("Subnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)this).Subnet = (string) content.GetValueForProperty("Subnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)this).Subnet, global::System.Convert.ToString); + } + if (content.Contains("Gateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)this).Gateway = (string) content.GetValueForProperty("Gateway",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)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 Ipv4Config(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.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)this).IPAddress = (string) content.GetValueForProperty("IPAddress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)this).IPAddress, global::System.Convert.ToString); + } + if (content.Contains("Subnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)this).Subnet = (string) content.GetValueForProperty("Subnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)this).Subnet, global::System.Convert.ToString); + } + if (content.Contains("Gateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)this).Gateway = (string) content.GetValueForProperty("Gateway",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Details related to the IPv4 address configuration. + [System.ComponentModel.TypeConverter(typeof(Ipv4ConfigTypeConverter))] + public partial interface IIpv4Config + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv4Config.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv4Config.TypeConverter.cs new file mode 100644 index 000000000000..2eaec75ea657 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv4Config.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class Ipv4ConfigTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IIpv4Config ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4Config).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Ipv4Config.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Ipv4Config.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Ipv4Config.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/databoxedge/generated/api/Models/Api20220301/Ipv4Config.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv4Config.cs new file mode 100644 index 000000000000..3d842d4b0da0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv4Config.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Details related to the IPv4 address configuration. + public partial class Ipv4Config : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4Config, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal + { + + /// Backing field for property. + private string _gateway; + + /// The IPv4 gateway of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Gateway { get => this._gateway; } + + /// Backing field for property. + private string _iPAddress; + + /// The IPv4 address of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string IPAddress { get => this._iPAddress; } + + /// Internal Acessors for Gateway + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal.Gateway { get => this._gateway; set { {_gateway = value;} } } + + /// Internal Acessors for IPAddress + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal.IPAddress { get => this._iPAddress; set { {_iPAddress = value;} } } + + /// Internal Acessors for Subnet + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal.Subnet { get => this._subnet; set { {_subnet = value;} } } + + /// Backing field for property. + private string _subnet; + + /// The IPv4 subnet of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Subnet { get => this._subnet; } + + /// Creates an new instance. + public Ipv4Config() + { + + } + } + /// Details related to the IPv4 address configuration. + public partial interface IIpv4Config : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The IPv4 gateway of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The IPv4 gateway of the network adapter.", + SerializedName = @"gateway", + PossibleTypes = new [] { typeof(string) })] + string Gateway { get; } + /// The IPv4 address of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The IPv4 address of the network adapter.", + SerializedName = @"ipAddress", + PossibleTypes = new [] { typeof(string) })] + string IPAddress { get; } + /// The IPv4 subnet of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The IPv4 subnet of the network adapter.", + SerializedName = @"subnet", + PossibleTypes = new [] { typeof(string) })] + string Subnet { get; } + + } + /// Details related to the IPv4 address configuration. + internal partial interface IIpv4ConfigInternal + + { + /// The IPv4 gateway of the network adapter. + string Gateway { get; set; } + /// The IPv4 address of the network adapter. + string IPAddress { get; set; } + /// The IPv4 subnet of the network adapter. + string Subnet { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv4Config.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv4Config.json.cs new file mode 100644 index 000000000000..1c979655d707 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv4Config.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Details related to the IPv4 address configuration. + public partial class Ipv4Config + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4Config. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4Config. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4Config FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new Ipv4Config(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal Ipv4Config(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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;} + {_subnet = If( json?.PropertyT("subnet"), out var __jsonSubnet) ? (string)__jsonSubnet : (string)Subnet;} + {_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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._iPAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._iPAddress.ToString()) : null, "ipAddress" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._subnet)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._subnet.ToString()) : null, "subnet" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._gateway)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/Ipv6Config.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv6Config.PowerShell.cs new file mode 100644 index 000000000000..48e847d9095a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv6Config.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Details related to the IPv6 address configuration. + [System.ComponentModel.TypeConverter(typeof(Ipv6ConfigTypeConverter))] + public partial class Ipv6Config + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IIpv6Config DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Ipv6Config(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.DataBoxEdge.Models.Api20220301.IIpv6Config DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Ipv6Config(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.DataBoxEdge.Models.Api20220301.IIpv6Config FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Ipv6Config(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.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)this).IPAddress = (string) content.GetValueForProperty("IPAddress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)this).IPAddress, global::System.Convert.ToString); + } + if (content.Contains("PrefixLength")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)this).PrefixLength = (int?) content.GetValueForProperty("PrefixLength",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)this).PrefixLength, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Gateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)this).Gateway = (string) content.GetValueForProperty("Gateway",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)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 Ipv6Config(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.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)this).IPAddress = (string) content.GetValueForProperty("IPAddress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)this).IPAddress, global::System.Convert.ToString); + } + if (content.Contains("PrefixLength")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)this).PrefixLength = (int?) content.GetValueForProperty("PrefixLength",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)this).PrefixLength, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Gateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)this).Gateway = (string) content.GetValueForProperty("Gateway",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Details related to the IPv6 address configuration. + [System.ComponentModel.TypeConverter(typeof(Ipv6ConfigTypeConverter))] + public partial interface IIpv6Config + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv6Config.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv6Config.TypeConverter.cs new file mode 100644 index 000000000000..93150d6325df --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv6Config.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class Ipv6ConfigTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IIpv6Config ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6Config).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Ipv6Config.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Ipv6Config.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Ipv6Config.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/databoxedge/generated/api/Models/Api20220301/Ipv6Config.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv6Config.cs new file mode 100644 index 000000000000..7d073ec09ae8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv6Config.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Details related to the IPv6 address configuration. + public partial class Ipv6Config : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6Config, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal + { + + /// Backing field for property. + private string _gateway; + + /// The IPv6 gateway of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Gateway { get => this._gateway; } + + /// Backing field for property. + private string _iPAddress; + + /// The IPv6 address of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string IPAddress { get => this._iPAddress; } + + /// Internal Acessors for Gateway + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal.Gateway { get => this._gateway; set { {_gateway = value;} } } + + /// Internal Acessors for IPAddress + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal.IPAddress { get => this._iPAddress; set { {_iPAddress = value;} } } + + /// Internal Acessors for PrefixLength + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal.PrefixLength { get => this._prefixLength; set { {_prefixLength = value;} } } + + /// Backing field for property. + private int? _prefixLength; + + /// The IPv6 prefix of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? PrefixLength { get => this._prefixLength; } + + /// Creates an new instance. + public Ipv6Config() + { + + } + } + /// Details related to the IPv6 address configuration. + public partial interface IIpv6Config : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The IPv6 gateway of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The IPv6 gateway of the network adapter.", + SerializedName = @"gateway", + PossibleTypes = new [] { typeof(string) })] + string Gateway { get; } + /// The IPv6 address of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The IPv6 address of the network adapter.", + SerializedName = @"ipAddress", + PossibleTypes = new [] { typeof(string) })] + string IPAddress { get; } + /// The IPv6 prefix of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The IPv6 prefix of the network adapter.", + SerializedName = @"prefixLength", + PossibleTypes = new [] { typeof(int) })] + int? PrefixLength { get; } + + } + /// Details related to the IPv6 address configuration. + internal partial interface IIpv6ConfigInternal + + { + /// The IPv6 gateway of the network adapter. + string Gateway { get; set; } + /// The IPv6 address of the network adapter. + string IPAddress { get; set; } + /// The IPv6 prefix of the network adapter. + int? PrefixLength { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv6Config.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv6Config.json.cs new file mode 100644 index 000000000000..71af5793a705 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Ipv6Config.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Details related to the IPv6 address configuration. + public partial class Ipv6Config + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6Config. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6Config. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6Config FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new Ipv6Config(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal Ipv6Config(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._iPAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._iPAddress.ToString()) : null, "ipAddress" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._prefixLength ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._prefixLength) : null, "prefixLength" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._gateway)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/Job.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Job.PowerShell.cs new file mode 100644 index 000000000000..15586c981487 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Job.PowerShell.cs @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// A device 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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IJob FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IJobInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus.CreateFrom); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IJobInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IJobInternal)this).PercentComplete = (int?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).PercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("JobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).JobType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType?) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).JobType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType.CreateFrom); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItem[]) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).ErrorDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobErrorItemTypeConverter.ConvertFrom)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("DownloadProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgress = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgress) content.GetValueForProperty("DownloadProgress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgress, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateDownloadProgressTypeConverter.ConvertFrom); + } + if (content.Contains("InstallProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).InstallProgress = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgress) content.GetValueForProperty("InstallProgress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).InstallProgress, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateInstallProgressTypeConverter.ConvertFrom); + } + if (content.Contains("CurrentStage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).CurrentStage = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage?) content.GetValueForProperty("CurrentStage",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).CurrentStage, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage.CreateFrom); + } + if (content.Contains("TotalRefreshError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).TotalRefreshError = (int?) content.GetValueForProperty("TotalRefreshError",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).TotalRefreshError, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ErrorManifestFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).ErrorManifestFile = (string) content.GetValueForProperty("ErrorManifestFile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).ErrorManifestFile, global::System.Convert.ToString); + } + if (content.Contains("RefreshedEntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).RefreshedEntityId = (string) content.GetValueForProperty("RefreshedEntityId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).RefreshedEntityId, global::System.Convert.ToString); + } + if (content.Contains("Folder")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Folder = (string) content.GetValueForProperty("Folder",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Folder, global::System.Convert.ToString); + } + if (content.Contains("DownloadProgressDownloadPhase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressDownloadPhase = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase?) content.GetValueForProperty("DownloadProgressDownloadPhase",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressDownloadPhase, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase.CreateFrom); + } + if (content.Contains("DownloadProgressPercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressPercentComplete = (int?) content.GetValueForProperty("DownloadProgressPercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressPercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressTotalBytesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressTotalBytesToDownload = (double?) content.GetValueForProperty("DownloadProgressTotalBytesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressTotalBytesToDownload, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("DownloadProgressTotalBytesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressTotalBytesDownloaded = (double?) content.GetValueForProperty("DownloadProgressTotalBytesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressTotalBytesDownloaded, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("DownloadProgressNumberOfUpdatesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressNumberOfUpdatesToDownload = (int?) content.GetValueForProperty("DownloadProgressNumberOfUpdatesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressNumberOfUpdatesToDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressNumberOfUpdatesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressNumberOfUpdatesDownloaded = (int?) content.GetValueForProperty("DownloadProgressNumberOfUpdatesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressNumberOfUpdatesDownloaded, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressPercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).InstallProgressPercentComplete = (int?) content.GetValueForProperty("InstallProgressPercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).InstallProgressPercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressNumberOfUpdatesToInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).InstallProgressNumberOfUpdatesToInstall = (int?) content.GetValueForProperty("InstallProgressNumberOfUpdatesToInstall",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).InstallProgressNumberOfUpdatesToInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressNumberOfUpdatesInstalled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).InstallProgressNumberOfUpdatesInstalled = (int?) content.GetValueForProperty("InstallProgressNumberOfUpdatesInstalled",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IJobInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus.CreateFrom); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IJobInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IJobInternal)this).PercentComplete = (int?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).PercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("JobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).JobType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType?) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).JobType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType.CreateFrom); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItem[]) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).ErrorDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobErrorItemTypeConverter.ConvertFrom)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("DownloadProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgress = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgress) content.GetValueForProperty("DownloadProgress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgress, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateDownloadProgressTypeConverter.ConvertFrom); + } + if (content.Contains("InstallProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).InstallProgress = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgress) content.GetValueForProperty("InstallProgress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).InstallProgress, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateInstallProgressTypeConverter.ConvertFrom); + } + if (content.Contains("CurrentStage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).CurrentStage = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage?) content.GetValueForProperty("CurrentStage",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).CurrentStage, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage.CreateFrom); + } + if (content.Contains("TotalRefreshError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).TotalRefreshError = (int?) content.GetValueForProperty("TotalRefreshError",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).TotalRefreshError, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ErrorManifestFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).ErrorManifestFile = (string) content.GetValueForProperty("ErrorManifestFile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).ErrorManifestFile, global::System.Convert.ToString); + } + if (content.Contains("RefreshedEntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).RefreshedEntityId = (string) content.GetValueForProperty("RefreshedEntityId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).RefreshedEntityId, global::System.Convert.ToString); + } + if (content.Contains("Folder")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Folder = (string) content.GetValueForProperty("Folder",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).Folder, global::System.Convert.ToString); + } + if (content.Contains("DownloadProgressDownloadPhase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressDownloadPhase = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase?) content.GetValueForProperty("DownloadProgressDownloadPhase",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressDownloadPhase, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase.CreateFrom); + } + if (content.Contains("DownloadProgressPercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressPercentComplete = (int?) content.GetValueForProperty("DownloadProgressPercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressPercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressTotalBytesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressTotalBytesToDownload = (double?) content.GetValueForProperty("DownloadProgressTotalBytesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressTotalBytesToDownload, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("DownloadProgressTotalBytesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressTotalBytesDownloaded = (double?) content.GetValueForProperty("DownloadProgressTotalBytesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressTotalBytesDownloaded, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("DownloadProgressNumberOfUpdatesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressNumberOfUpdatesToDownload = (int?) content.GetValueForProperty("DownloadProgressNumberOfUpdatesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressNumberOfUpdatesToDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressNumberOfUpdatesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressNumberOfUpdatesDownloaded = (int?) content.GetValueForProperty("DownloadProgressNumberOfUpdatesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).DownloadProgressNumberOfUpdatesDownloaded, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressPercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).InstallProgressPercentComplete = (int?) content.GetValueForProperty("InstallProgressPercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).InstallProgressPercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressNumberOfUpdatesToInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).InstallProgressNumberOfUpdatesToInstall = (int?) content.GetValueForProperty("InstallProgressNumberOfUpdatesToInstall",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).InstallProgressNumberOfUpdatesToInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressNumberOfUpdatesInstalled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal)this).InstallProgressNumberOfUpdatesInstalled = (int?) content.GetValueForProperty("InstallProgressNumberOfUpdatesInstalled",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A device job. + [System.ComponentModel.TypeConverter(typeof(JobTypeConverter))] + public partial interface IJob + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Job.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Job.TypeConverter.cs new file mode 100644 index 000000000000..c225d3c842f4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Job.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IJob ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/Job.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Job.cs new file mode 100644 index 000000000000..8db93a3cc701 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Job.cs @@ -0,0 +1,526 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// A device job. + public partial class Job : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJob, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal + { + + /// The code intended for programmatic access. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal)Error).Code; } + + /// Current stage of the update operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage? CurrentStage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).CurrentStage; } + + /// The download phase. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase? DownloadProgressDownloadPhase { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgressDownloadPhase; } + + /// Number of updates downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? DownloadProgressNumberOfUpdatesDownloaded { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgressNumberOfUpdatesDownloaded; } + + /// Number of updates to download. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? DownloadProgressNumberOfUpdatesToDownload { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgressNumberOfUpdatesToDownload; } + + /// Percentage of completion. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? DownloadProgressPercentComplete { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgressPercentComplete; } + + /// Total bytes downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? DownloadProgressTotalBytesDownloaded { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgressTotalBytesDownloaded; } + + /// Total bytes to download. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? DownloadProgressTotalBytesToDownload { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgressTotalBytesToDownload; } + + /// Backing field for property. + private global::System.DateTime? _endTime; + + /// The UTC date and time at which the job completed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? EndTime { get => this._endTime; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetails _error; + + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobErrorDetails()); } + + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItem[] ErrorDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal)Error).ErrorDetail; } + + /// + /// Local share/remote container relative path to the error manifest file of the refresh. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ErrorManifestFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).ErrorManifestFile; } + + /// + /// If only subfolders need to be refreshed, then the subfolder path inside the share or container. (The path is empty if + /// there are no subfolders.) + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Folder { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).Folder; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).Folder = value ?? null; } + + /// Backing field for property. + private string _id; + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Number of updates installed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? InstallProgressNumberOfUpdatesInstalled { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).InstallProgressNumberOfUpdatesInstalled; } + + /// Number of updates to install. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? InstallProgressNumberOfUpdatesToInstall { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).InstallProgressNumberOfUpdatesToInstall; } + + /// Percentage completed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? InstallProgressPercentComplete { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).InstallProgressPercentComplete; } + + /// The type of the job. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType? JobType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).JobType; } + + /// The message that describes the error in detail. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal)Error).Message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal)Error).Code = value; } + + /// Internal Acessors for CurrentStage + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.CurrentStage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).CurrentStage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).CurrentStage = value; } + + /// Internal Acessors for DownloadProgress + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgress Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.DownloadProgress { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgress; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgress = value; } + + /// Internal Acessors for DownloadProgressDownloadPhase + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.DownloadProgressDownloadPhase { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgressDownloadPhase; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgressDownloadPhase = value; } + + /// Internal Acessors for DownloadProgressNumberOfUpdatesDownloaded + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.DownloadProgressNumberOfUpdatesDownloaded { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgressNumberOfUpdatesDownloaded; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgressNumberOfUpdatesDownloaded = value; } + + /// Internal Acessors for DownloadProgressNumberOfUpdatesToDownload + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.DownloadProgressNumberOfUpdatesToDownload { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgressNumberOfUpdatesToDownload; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgressNumberOfUpdatesToDownload = value; } + + /// Internal Acessors for DownloadProgressPercentComplete + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.DownloadProgressPercentComplete { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgressPercentComplete; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgressPercentComplete = value; } + + /// Internal Acessors for DownloadProgressTotalBytesDownloaded + double? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.DownloadProgressTotalBytesDownloaded { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgressTotalBytesDownloaded; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgressTotalBytesDownloaded = value; } + + /// Internal Acessors for DownloadProgressTotalBytesToDownload + double? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.DownloadProgressTotalBytesToDownload { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgressTotalBytesToDownload; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).DownloadProgressTotalBytesToDownload = value; } + + /// Internal Acessors for EndTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.EndTime { get => this._endTime; set { {_endTime = value;} } } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetails Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobErrorDetails()); set { {_error = value;} } } + + /// Internal Acessors for ErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItem[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.ErrorDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal)Error).ErrorDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal)Error).ErrorDetail = value; } + + /// Internal Acessors for ErrorManifestFile + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.ErrorManifestFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).ErrorManifestFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).ErrorManifestFile = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for InstallProgress + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgress Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.InstallProgress { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).InstallProgress; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).InstallProgress = value; } + + /// Internal Acessors for InstallProgressNumberOfUpdatesInstalled + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.InstallProgressNumberOfUpdatesInstalled { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).InstallProgressNumberOfUpdatesInstalled; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).InstallProgressNumberOfUpdatesInstalled = value; } + + /// Internal Acessors for InstallProgressNumberOfUpdatesToInstall + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.InstallProgressNumberOfUpdatesToInstall { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).InstallProgressNumberOfUpdatesToInstall; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).InstallProgressNumberOfUpdatesToInstall = value; } + + /// Internal Acessors for InstallProgressPercentComplete + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.InstallProgressPercentComplete { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).InstallProgressPercentComplete; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).InstallProgressPercentComplete = value; } + + /// Internal Acessors for JobType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.JobType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).JobType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).JobType = value; } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal)Error).Message = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for PercentComplete + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.PercentComplete { get => this._percentComplete; set { {_percentComplete = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobProperties()); set { {_property = value;} } } + + /// Internal Acessors for RefreshedEntityId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.RefreshedEntityId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).RefreshedEntityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).RefreshedEntityId = value; } + + /// Internal Acessors for StartTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.StartTime { get => this._startTime; set { {_startTime = value;} } } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.Status { get => this._status; set { {_status = value;} } } + + /// Internal Acessors for TotalRefreshError + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.TotalRefreshError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).TotalRefreshError; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).TotalRefreshError = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private int? _percentComplete; + + /// The percentage of the job that is complete. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? PercentComplete { get => this._percentComplete; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobProperties _property; + + /// The properties of the job. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobProperties()); } + + /// ARM ID of the entity that was refreshed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string RefreshedEntityId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).RefreshedEntityId; } + + /// Backing field for property. + private global::System.DateTime? _startTime; + + /// The UTC date and time at which the job started. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? StartTime { get => this._startTime; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? _status; + + /// The current status of the job. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? Status { get => this._status; } + + /// Total number of errors encountered during the refresh process. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? TotalRefreshError { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)Property).TotalRefreshError; } + + /// Backing field for property. + private string _type; + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public Job() + { + + } + } + /// A device job. + public partial interface IJob : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The code intended for programmatic access. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The code intended for programmatic access.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// Current stage of the update operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current stage of the update operation.", + SerializedName = @"currentStage", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage? CurrentStage { get; } + /// The download phase. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The download phase.", + SerializedName = @"downloadPhase", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase? DownloadProgressDownloadPhase { get; } + /// Number of updates downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of updates downloaded.", + SerializedName = @"numberOfUpdatesDownloaded", + PossibleTypes = new [] { typeof(int) })] + int? DownloadProgressNumberOfUpdatesDownloaded { get; } + /// Number of updates to download. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of updates to download.", + SerializedName = @"numberOfUpdatesToDownload", + PossibleTypes = new [] { typeof(int) })] + int? DownloadProgressNumberOfUpdatesToDownload { get; } + /// Percentage of completion. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Percentage of completion.", + SerializedName = @"percentComplete", + PossibleTypes = new [] { typeof(int) })] + int? DownloadProgressPercentComplete { get; } + /// Total bytes downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total bytes downloaded.", + SerializedName = @"totalBytesDownloaded", + PossibleTypes = new [] { typeof(double) })] + double? DownloadProgressTotalBytesDownloaded { get; } + /// Total bytes to download. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total bytes to download.", + SerializedName = @"totalBytesToDownload", + PossibleTypes = new [] { typeof(double) })] + double? DownloadProgressTotalBytesToDownload { get; } + /// The UTC date and time at which the job completed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The UTC date and time at which the job completed.", + SerializedName = @"endTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndTime { get; } + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error details.", + SerializedName = @"errorDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItem) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItem[] ErrorDetail { get; } + /// + /// Local share/remote container relative path to the error manifest file of the refresh. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Local share/remote container relative path to the error manifest file of the refresh.", + SerializedName = @"errorManifestFile", + PossibleTypes = new [] { typeof(string) })] + string ErrorManifestFile { get; } + /// + /// If only subfolders need to be refreshed, then the subfolder path inside the share or container. (The path is empty if + /// there are no subfolders.) + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If only subfolders need to be refreshed, then the subfolder path inside the share or container. (The path is empty if there are no subfolders.)", + SerializedName = @"folder", + PossibleTypes = new [] { typeof(string) })] + string Folder { get; set; } + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The path ID that uniquely identifies the object.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Number of updates installed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of updates installed.", + SerializedName = @"numberOfUpdatesInstalled", + PossibleTypes = new [] { typeof(int) })] + int? InstallProgressNumberOfUpdatesInstalled { get; } + /// Number of updates to install. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of updates to install.", + SerializedName = @"numberOfUpdatesToInstall", + PossibleTypes = new [] { typeof(int) })] + int? InstallProgressNumberOfUpdatesToInstall { get; } + /// Percentage completed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Percentage completed.", + SerializedName = @"percentComplete", + PossibleTypes = new [] { typeof(int) })] + int? InstallProgressPercentComplete { get; } + /// The type of the job. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of the job.", + SerializedName = @"jobType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType? JobType { get; } + /// The message that describes the error in detail. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The message that describes the error in detail.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// The name of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the object.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// The percentage of the job that is complete. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The percentage of the job that is complete.", + SerializedName = @"percentComplete", + PossibleTypes = new [] { typeof(int) })] + int? PercentComplete { get; } + /// ARM ID of the entity that was refreshed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"ARM ID of the entity that was refreshed.", + SerializedName = @"refreshedEntityId", + PossibleTypes = new [] { typeof(string) })] + string RefreshedEntityId { get; } + /// The UTC date and time at which the job started. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The UTC date and time at which the job started.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartTime { get; } + /// The current status of the job. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current status of the job.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? Status { get; } + /// Total number of errors encountered during the refresh process. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of errors encountered during the refresh process.", + SerializedName = @"totalRefreshErrors", + PossibleTypes = new [] { typeof(int) })] + int? TotalRefreshError { get; } + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The hierarchical type of the object.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// A device job. + internal partial interface IJobInternal + + { + /// The code intended for programmatic access. + string Code { get; set; } + /// Current stage of the update operation. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage? CurrentStage { get; set; } + /// The download progress. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgress DownloadProgress { get; set; } + /// The download phase. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 date and time at which the job completed. + global::System.DateTime? EndTime { get; set; } + /// The error details. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetails Error { get; set; } + /// The error details. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItem[] ErrorDetail { get; set; } + /// + /// Local share/remote container relative path to the error manifest file of the refresh. + /// + string ErrorManifestFile { get; set; } + /// + /// If only subfolders need to be refreshed, then the subfolder path inside the share or container. (The path is empty if + /// there are no subfolders.) + /// + string Folder { get; set; } + /// The path ID that uniquely identifies the object. + string Id { get; set; } + /// The install progress. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgress InstallProgress { get; set; } + /// Number of updates installed. + int? InstallProgressNumberOfUpdatesInstalled { get; set; } + /// Number of updates to install. + int? InstallProgressNumberOfUpdatesToInstall { get; set; } + /// Percentage completed. + int? InstallProgressPercentComplete { get; set; } + /// The type of the job. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType? JobType { get; set; } + /// The message that describes the error in detail. + string Message { get; set; } + /// The name of the object. + string Name { get; set; } + /// The percentage of the job that is complete. + int? PercentComplete { get; set; } + /// The properties of the job. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobProperties Property { get; set; } + /// ARM ID of the entity that was refreshed. + string RefreshedEntityId { get; set; } + /// The UTC date and time at which the job started. + global::System.DateTime? StartTime { get; set; } + /// The current status of the job. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? Status { get; set; } + /// Total number of errors encountered during the refresh process. + int? TotalRefreshError { get; set; } + /// The hierarchical type of the object. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Job.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Job.json.cs new file mode 100644 index 000000000000..e65e37ce8cf1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Job.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// A device 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJob. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJob FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new Job(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal Job(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobErrorDetails.FromJson(__jsonError) : Error;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobProperties.FromJson(__jsonProperties) : Property;} + {_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;} + {_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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._startTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._endTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._endTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._percentComplete ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._percentComplete) : null, "percentComplete" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/JobErrorDetails.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobErrorDetails.PowerShell.cs new file mode 100644 index 000000000000..d3f5303bd98c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobErrorDetails.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The job error information containing the list of job errors. + [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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IJobErrorDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItem[]) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal)this).ErrorDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobErrorItemTypeConverter.ConvertFrom)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItem[]) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal)this).ErrorDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.JobErrorItemTypeConverter.ConvertFrom)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The job error information containing the list of job errors. + [System.ComponentModel.TypeConverter(typeof(JobErrorDetailsTypeConverter))] + public partial interface IJobErrorDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/JobErrorDetails.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobErrorDetails.TypeConverter.cs new file mode 100644 index 000000000000..bae62652dfcc --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IJobErrorDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/JobErrorDetails.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobErrorDetails.cs new file mode 100644 index 000000000000..d2422ffeb29a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobErrorDetails.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The job error information containing the list of job errors. + public partial class JobErrorDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetails, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal + { + + /// Backing field for property. + private string _code; + + /// The code intended for programmatic access. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Code { get => this._code; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItem[] _errorDetail; + + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItem[] ErrorDetail { get => this._errorDetail; } + + /// Backing field for property. + private string _message; + + /// The message that describes the error in detail. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal.Code { get => this._code; set { {_code = value;} } } + + /// Internal Acessors for ErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItem[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal.ErrorDetail { get => this._errorDetail; set { {_errorDetail = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetailsInternal.Message { get => this._message; set { {_message = value;} } } + + /// Creates an new instance. + public JobErrorDetails() + { + + } + } + /// The job error information containing the list of job errors. + public partial interface IJobErrorDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The code intended for programmatic access. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The code intended for programmatic access.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error details.", + SerializedName = @"errorDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItem) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItem[] ErrorDetail { get; } + /// The message that describes the error in detail. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The message that describes the error in detail.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + + } + /// The job error information containing the list of job errors. + internal partial interface IJobErrorDetailsInternal + + { + /// The code intended for programmatic access. + string Code { get; set; } + /// The error details. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItem[] ErrorDetail { get; set; } + /// The message that describes the error in detail. + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/JobErrorDetails.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobErrorDetails.json.cs new file mode 100644 index 000000000000..27f4c612cd9e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobErrorDetails.json.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The job error information containing the list of job errors. + 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new JobErrorDetails(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal JobErrorDetails(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IJobErrorItem) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._errorDetail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._errorDetail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("errorDetails",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/JobErrorItem.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobErrorItem.PowerShell.cs new file mode 100644 index 000000000000..7ae2d304216b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobErrorItem.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IJobErrorItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IJobErrorItemInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItemInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItemInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItemInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItemInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IJobErrorItemInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItemInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItemInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItemInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItemInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/JobErrorItem.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobErrorItem.TypeConverter.cs new file mode 100644 index 000000000000..efd17fd464a6 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IJobErrorItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/JobErrorItem.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobErrorItem.cs new file mode 100644 index 000000000000..52b496172753 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobErrorItem.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The job error items. + public partial class JobErrorItem : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItem, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItemInternal + { + + /// Backing field for property. + private string _code; + + /// The code intended for programmatic access. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Code { get => this._code; } + + /// Backing field for property. + private string _message; + + /// The message that describes the error in detail. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItemInternal.Code { get => this._code; set { {_code = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItemInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for Recommendation + string[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItemInternal.Recommendation { get => this._recommendation; set { {_recommendation = value;} } } + + /// Backing field for property. + private string[] _recommendation; + + /// The recommended actions. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string[] Recommendation { get => this._recommendation; } + + /// Creates an new instance. + public JobErrorItem() + { + + } + } + /// The job error items. + public partial interface IJobErrorItem : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The code intended for programmatic access. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The code intended for programmatic access.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// The message that describes the error in detail. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The message that describes the error in detail.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// The recommended actions. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The recommended actions.", + SerializedName = @"recommendations", + PossibleTypes = new [] { typeof(string) })] + string[] Recommendation { get; } + + } + /// The job error items. + internal partial interface IJobErrorItemInternal + + { + /// The code intended for programmatic access. + string Code { get; set; } + /// The message that describes 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/databoxedge/generated/api/Models/Api20220301/JobErrorItem.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobErrorItem.json.cs new file mode 100644 index 000000000000..7911c2510e25 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobErrorItem.json.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobErrorItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new JobErrorItem(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal JobErrorItem(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._recommendation) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._recommendation ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("recommendations",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/JobProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobProperties.PowerShell.cs new file mode 100644 index 000000000000..d76a235de238 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobProperties.PowerShell.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The 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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IJobProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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("DownloadProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgress = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgress) content.GetValueForProperty("DownloadProgress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgress, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateDownloadProgressTypeConverter.ConvertFrom); + } + if (content.Contains("InstallProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).InstallProgress = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgress) content.GetValueForProperty("InstallProgress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).InstallProgress, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateInstallProgressTypeConverter.ConvertFrom); + } + if (content.Contains("JobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).JobType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType?) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).JobType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType.CreateFrom); + } + if (content.Contains("CurrentStage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).CurrentStage = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage?) content.GetValueForProperty("CurrentStage",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).CurrentStage, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage.CreateFrom); + } + if (content.Contains("TotalRefreshError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).TotalRefreshError = (int?) content.GetValueForProperty("TotalRefreshError",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).TotalRefreshError, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ErrorManifestFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).ErrorManifestFile = (string) content.GetValueForProperty("ErrorManifestFile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).ErrorManifestFile, global::System.Convert.ToString); + } + if (content.Contains("RefreshedEntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).RefreshedEntityId = (string) content.GetValueForProperty("RefreshedEntityId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).RefreshedEntityId, global::System.Convert.ToString); + } + if (content.Contains("Folder")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).Folder = (string) content.GetValueForProperty("Folder",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).Folder, global::System.Convert.ToString); + } + if (content.Contains("DownloadProgressDownloadPhase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressDownloadPhase = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase?) content.GetValueForProperty("DownloadProgressDownloadPhase",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressDownloadPhase, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase.CreateFrom); + } + if (content.Contains("DownloadProgressPercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressPercentComplete = (int?) content.GetValueForProperty("DownloadProgressPercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressPercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressTotalBytesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressTotalBytesToDownload = (double?) content.GetValueForProperty("DownloadProgressTotalBytesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressTotalBytesToDownload, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("DownloadProgressTotalBytesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressTotalBytesDownloaded = (double?) content.GetValueForProperty("DownloadProgressTotalBytesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressTotalBytesDownloaded, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("DownloadProgressNumberOfUpdatesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressNumberOfUpdatesToDownload = (int?) content.GetValueForProperty("DownloadProgressNumberOfUpdatesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressNumberOfUpdatesToDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressNumberOfUpdatesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressNumberOfUpdatesDownloaded = (int?) content.GetValueForProperty("DownloadProgressNumberOfUpdatesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressNumberOfUpdatesDownloaded, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressPercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).InstallProgressPercentComplete = (int?) content.GetValueForProperty("InstallProgressPercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).InstallProgressPercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressNumberOfUpdatesToInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).InstallProgressNumberOfUpdatesToInstall = (int?) content.GetValueForProperty("InstallProgressNumberOfUpdatesToInstall",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).InstallProgressNumberOfUpdatesToInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressNumberOfUpdatesInstalled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).InstallProgressNumberOfUpdatesInstalled = (int?) content.GetValueForProperty("InstallProgressNumberOfUpdatesInstalled",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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("DownloadProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgress = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgress) content.GetValueForProperty("DownloadProgress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgress, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateDownloadProgressTypeConverter.ConvertFrom); + } + if (content.Contains("InstallProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).InstallProgress = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgress) content.GetValueForProperty("InstallProgress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).InstallProgress, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateInstallProgressTypeConverter.ConvertFrom); + } + if (content.Contains("JobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).JobType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType?) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).JobType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType.CreateFrom); + } + if (content.Contains("CurrentStage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).CurrentStage = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage?) content.GetValueForProperty("CurrentStage",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).CurrentStage, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage.CreateFrom); + } + if (content.Contains("TotalRefreshError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).TotalRefreshError = (int?) content.GetValueForProperty("TotalRefreshError",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).TotalRefreshError, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ErrorManifestFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).ErrorManifestFile = (string) content.GetValueForProperty("ErrorManifestFile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).ErrorManifestFile, global::System.Convert.ToString); + } + if (content.Contains("RefreshedEntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).RefreshedEntityId = (string) content.GetValueForProperty("RefreshedEntityId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).RefreshedEntityId, global::System.Convert.ToString); + } + if (content.Contains("Folder")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).Folder = (string) content.GetValueForProperty("Folder",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).Folder, global::System.Convert.ToString); + } + if (content.Contains("DownloadProgressDownloadPhase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressDownloadPhase = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase?) content.GetValueForProperty("DownloadProgressDownloadPhase",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressDownloadPhase, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase.CreateFrom); + } + if (content.Contains("DownloadProgressPercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressPercentComplete = (int?) content.GetValueForProperty("DownloadProgressPercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressPercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressTotalBytesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressTotalBytesToDownload = (double?) content.GetValueForProperty("DownloadProgressTotalBytesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressTotalBytesToDownload, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("DownloadProgressTotalBytesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressTotalBytesDownloaded = (double?) content.GetValueForProperty("DownloadProgressTotalBytesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressTotalBytesDownloaded, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("DownloadProgressNumberOfUpdatesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressNumberOfUpdatesToDownload = (int?) content.GetValueForProperty("DownloadProgressNumberOfUpdatesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressNumberOfUpdatesToDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressNumberOfUpdatesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressNumberOfUpdatesDownloaded = (int?) content.GetValueForProperty("DownloadProgressNumberOfUpdatesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).DownloadProgressNumberOfUpdatesDownloaded, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressPercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).InstallProgressPercentComplete = (int?) content.GetValueForProperty("InstallProgressPercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).InstallProgressPercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressNumberOfUpdatesToInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).InstallProgressNumberOfUpdatesToInstall = (int?) content.GetValueForProperty("InstallProgressNumberOfUpdatesToInstall",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).InstallProgressNumberOfUpdatesToInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressNumberOfUpdatesInstalled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal)this).InstallProgressNumberOfUpdatesInstalled = (int?) content.GetValueForProperty("InstallProgressNumberOfUpdatesInstalled",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties for the job. + [System.ComponentModel.TypeConverter(typeof(JobPropertiesTypeConverter))] + public partial interface IJobProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/JobProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobProperties.TypeConverter.cs new file mode 100644 index 000000000000..4b39d0b4cb5a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IJobProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/JobProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobProperties.cs new file mode 100644 index 000000000000..df07355dae3a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobProperties.cs @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The properties for the job. + public partial class JobProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage? _currentStage; + + /// Current stage of the update operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage? CurrentStage { get => this._currentStage; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgress _downloadProgress; + + /// The download progress. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgress DownloadProgress { get => (this._downloadProgress = this._downloadProgress ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateDownloadProgress()); } + + /// The download phase. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase? DownloadProgressDownloadPhase { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)DownloadProgress).DownloadPhase; } + + /// Number of updates downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? DownloadProgressNumberOfUpdatesDownloaded { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)DownloadProgress).NumberOfUpdatesDownloaded; } + + /// Number of updates to download. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? DownloadProgressNumberOfUpdatesToDownload { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)DownloadProgress).NumberOfUpdatesToDownload; } + + /// Percentage of completion. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? DownloadProgressPercentComplete { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)DownloadProgress).PercentComplete; } + + /// Total bytes downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? DownloadProgressTotalBytesDownloaded { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)DownloadProgress).TotalBytesDownloaded; } + + /// Total bytes to download. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? DownloadProgressTotalBytesToDownload { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)DownloadProgress).TotalBytesToDownload; } + + /// Backing field for property. + private string _errorManifestFile; + + /// + /// Local share/remote container relative path to the error manifest file of the refresh. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ErrorManifestFile { get => this._errorManifestFile; } + + /// Backing field for property. + private string _folder; + + /// + /// If only subfolders need to be refreshed, then the subfolder path inside the share or container. (The path is empty if + /// there are no subfolders.) + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Folder { get => this._folder; set => this._folder = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgress _installProgress; + + /// The install progress. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgress InstallProgress { get => (this._installProgress = this._installProgress ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateInstallProgress()); } + + /// Number of updates installed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? InstallProgressNumberOfUpdatesInstalled { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)InstallProgress).NumberOfUpdatesInstalled; } + + /// Number of updates to install. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? InstallProgressNumberOfUpdatesToInstall { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)InstallProgress).NumberOfUpdatesToInstall; } + + /// Percentage completed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? InstallProgressPercentComplete { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)InstallProgress).PercentComplete; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType? _jobType; + + /// The type of the job. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType? JobType { get => this._jobType; } + + /// Internal Acessors for CurrentStage + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal.CurrentStage { get => this._currentStage; set { {_currentStage = value;} } } + + /// Internal Acessors for DownloadProgress + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgress Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal.DownloadProgress { get => (this._downloadProgress = this._downloadProgress ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateDownloadProgress()); set { {_downloadProgress = value;} } } + + /// Internal Acessors for DownloadProgressDownloadPhase + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal.DownloadProgressDownloadPhase { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)DownloadProgress).DownloadPhase; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)DownloadProgress).DownloadPhase = value; } + + /// Internal Acessors for DownloadProgressNumberOfUpdatesDownloaded + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal.DownloadProgressNumberOfUpdatesDownloaded { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)DownloadProgress).NumberOfUpdatesDownloaded; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)DownloadProgress).NumberOfUpdatesDownloaded = value; } + + /// Internal Acessors for DownloadProgressNumberOfUpdatesToDownload + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal.DownloadProgressNumberOfUpdatesToDownload { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)DownloadProgress).NumberOfUpdatesToDownload; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)DownloadProgress).NumberOfUpdatesToDownload = value; } + + /// Internal Acessors for DownloadProgressPercentComplete + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal.DownloadProgressPercentComplete { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)DownloadProgress).PercentComplete; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)DownloadProgress).PercentComplete = value; } + + /// Internal Acessors for DownloadProgressTotalBytesDownloaded + double? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal.DownloadProgressTotalBytesDownloaded { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)DownloadProgress).TotalBytesDownloaded; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)DownloadProgress).TotalBytesDownloaded = value; } + + /// Internal Acessors for DownloadProgressTotalBytesToDownload + double? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal.DownloadProgressTotalBytesToDownload { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)DownloadProgress).TotalBytesToDownload; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)DownloadProgress).TotalBytesToDownload = value; } + + /// Internal Acessors for ErrorManifestFile + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal.ErrorManifestFile { get => this._errorManifestFile; set { {_errorManifestFile = value;} } } + + /// Internal Acessors for InstallProgress + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgress Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal.InstallProgress { get => (this._installProgress = this._installProgress ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateInstallProgress()); set { {_installProgress = value;} } } + + /// Internal Acessors for InstallProgressNumberOfUpdatesInstalled + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal.InstallProgressNumberOfUpdatesInstalled { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)InstallProgress).NumberOfUpdatesInstalled; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)InstallProgress).NumberOfUpdatesInstalled = value; } + + /// Internal Acessors for InstallProgressNumberOfUpdatesToInstall + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal.InstallProgressNumberOfUpdatesToInstall { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)InstallProgress).NumberOfUpdatesToInstall; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)InstallProgress).NumberOfUpdatesToInstall = value; } + + /// Internal Acessors for InstallProgressPercentComplete + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal.InstallProgressPercentComplete { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)InstallProgress).PercentComplete; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)InstallProgress).PercentComplete = value; } + + /// Internal Acessors for JobType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal.JobType { get => this._jobType; set { {_jobType = value;} } } + + /// Internal Acessors for RefreshedEntityId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal.RefreshedEntityId { get => this._refreshedEntityId; set { {_refreshedEntityId = value;} } } + + /// Internal Acessors for TotalRefreshError + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobPropertiesInternal.TotalRefreshError { get => this._totalRefreshError; set { {_totalRefreshError = value;} } } + + /// Backing field for property. + private string _refreshedEntityId; + + /// ARM ID of the entity that was refreshed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string RefreshedEntityId { get => this._refreshedEntityId; } + + /// Backing field for property. + private int? _totalRefreshError; + + /// Total number of errors encountered during the refresh process. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? TotalRefreshError { get => this._totalRefreshError; } + + /// Creates an new instance. + public JobProperties() + { + + } + } + /// The properties for the job. + public partial interface IJobProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Current stage of the update operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Current stage of the update operation.", + SerializedName = @"currentStage", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage? CurrentStage { get; } + /// The download phase. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The download phase.", + SerializedName = @"downloadPhase", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase? DownloadProgressDownloadPhase { get; } + /// Number of updates downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of updates downloaded.", + SerializedName = @"numberOfUpdatesDownloaded", + PossibleTypes = new [] { typeof(int) })] + int? DownloadProgressNumberOfUpdatesDownloaded { get; } + /// Number of updates to download. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of updates to download.", + SerializedName = @"numberOfUpdatesToDownload", + PossibleTypes = new [] { typeof(int) })] + int? DownloadProgressNumberOfUpdatesToDownload { get; } + /// Percentage of completion. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Percentage of completion.", + SerializedName = @"percentComplete", + PossibleTypes = new [] { typeof(int) })] + int? DownloadProgressPercentComplete { get; } + /// Total bytes downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total bytes downloaded.", + SerializedName = @"totalBytesDownloaded", + PossibleTypes = new [] { typeof(double) })] + double? DownloadProgressTotalBytesDownloaded { get; } + /// Total bytes to download. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total bytes to download.", + SerializedName = @"totalBytesToDownload", + PossibleTypes = new [] { typeof(double) })] + double? DownloadProgressTotalBytesToDownload { get; } + /// + /// Local share/remote container relative path to the error manifest file of the refresh. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Local share/remote container relative path to the error manifest file of the refresh.", + SerializedName = @"errorManifestFile", + PossibleTypes = new [] { typeof(string) })] + string ErrorManifestFile { get; } + /// + /// If only subfolders need to be refreshed, then the subfolder path inside the share or container. (The path is empty if + /// there are no subfolders.) + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If only subfolders need to be refreshed, then the subfolder path inside the share or container. (The path is empty if there are no subfolders.)", + SerializedName = @"folder", + PossibleTypes = new [] { typeof(string) })] + string Folder { get; set; } + /// Number of updates installed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of updates installed.", + SerializedName = @"numberOfUpdatesInstalled", + PossibleTypes = new [] { typeof(int) })] + int? InstallProgressNumberOfUpdatesInstalled { get; } + /// Number of updates to install. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of updates to install.", + SerializedName = @"numberOfUpdatesToInstall", + PossibleTypes = new [] { typeof(int) })] + int? InstallProgressNumberOfUpdatesToInstall { get; } + /// Percentage completed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Percentage completed.", + SerializedName = @"percentComplete", + PossibleTypes = new [] { typeof(int) })] + int? InstallProgressPercentComplete { get; } + /// The type of the job. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of the job.", + SerializedName = @"jobType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType? JobType { get; } + /// ARM ID of the entity that was refreshed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"ARM ID of the entity that was refreshed.", + SerializedName = @"refreshedEntityId", + PossibleTypes = new [] { typeof(string) })] + string RefreshedEntityId { get; } + /// Total number of errors encountered during the refresh process. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of errors encountered during the refresh process.", + SerializedName = @"totalRefreshErrors", + PossibleTypes = new [] { typeof(int) })] + int? TotalRefreshError { get; } + + } + /// The properties for the job. + internal partial interface IJobPropertiesInternal + + { + /// Current stage of the update operation. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage? CurrentStage { get; set; } + /// The download progress. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgress DownloadProgress { get; set; } + /// The download phase. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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; } + /// + /// Local share/remote container relative path to the error manifest file of the refresh. + /// + string ErrorManifestFile { get; set; } + /// + /// If only subfolders need to be refreshed, then the subfolder path inside the share or container. (The path is empty if + /// there are no subfolders.) + /// + string Folder { get; set; } + /// The install progress. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgress InstallProgress { get; set; } + /// Number of updates installed. + int? InstallProgressNumberOfUpdatesInstalled { get; set; } + /// Number of updates to install. + int? InstallProgressNumberOfUpdatesToInstall { get; set; } + /// Percentage completed. + int? InstallProgressPercentComplete { get; set; } + /// The type of the job. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType? JobType { get; set; } + /// ARM ID of the entity that was refreshed. + string RefreshedEntityId { get; set; } + /// Total number of errors encountered during the refresh process. + int? TotalRefreshError { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/JobProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobProperties.json.cs new file mode 100644 index 000000000000..6da3e696f72e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/JobProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJobProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new JobProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal JobProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_downloadProgress = If( json?.PropertyT("downloadProgress"), out var __jsonDownloadProgress) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateDownloadProgress.FromJson(__jsonDownloadProgress) : DownloadProgress;} + {_installProgress = If( json?.PropertyT("installProgress"), out var __jsonInstallProgress) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateInstallProgress.FromJson(__jsonInstallProgress) : InstallProgress;} + {_jobType = If( json?.PropertyT("jobType"), out var __jsonJobType) ? (string)__jsonJobType : (string)JobType;} + {_currentStage = If( json?.PropertyT("currentStage"), out var __jsonCurrentStage) ? (string)__jsonCurrentStage : (string)CurrentStage;} + {_totalRefreshError = If( json?.PropertyT("totalRefreshErrors"), out var __jsonTotalRefreshErrors) ? (int?)__jsonTotalRefreshErrors : TotalRefreshError;} + {_errorManifestFile = If( json?.PropertyT("errorManifestFile"), out var __jsonErrorManifestFile) ? (string)__jsonErrorManifestFile : (string)ErrorManifestFile;} + {_refreshedEntityId = If( json?.PropertyT("refreshedEntityId"), out var __jsonRefreshedEntityId) ? (string)__jsonRefreshedEntityId : (string)RefreshedEntityId;} + {_folder = If( json?.PropertyT("folder"), out var __jsonFolder) ? (string)__jsonFolder : (string)Folder;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._downloadProgress ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._downloadProgress.ToJson(null,serializationMode) : null, "downloadProgress" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._installProgress ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._installProgress.ToJson(null,serializationMode) : null, "installProgress" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._jobType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._jobType.ToString()) : null, "jobType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._currentStage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._currentStage.ToString()) : null, "currentStage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalRefreshError ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._totalRefreshError) : null, "totalRefreshErrors" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._errorManifestFile)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._errorManifestFile.ToString()) : null, "errorManifestFile" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._refreshedEntityId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._refreshedEntityId.ToString()) : null, "refreshedEntityId" ,container.Add ); + } + AddIf( null != (((object)this._folder)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._folder.ToString()) : null, "folder" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesClusterInfo.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesClusterInfo.PowerShell.cs new file mode 100644 index 000000000000..e4837858e781 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesClusterInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Kubernetes cluster configuration + [System.ComponentModel.TypeConverter(typeof(KubernetesClusterInfoTypeConverter))] + public partial class KubernetesClusterInfo + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesClusterInfo(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.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesClusterInfo(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.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesClusterInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EtcdInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).EtcdInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfo) content.GetValueForProperty("EtcdInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).EtcdInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EtcdInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Node")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).Node = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo[]) content.GetValueForProperty("Node",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).Node, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodeInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("EtcdInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).EtcdInfoType = (string) content.GetValueForProperty("EtcdInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).EtcdInfoType, global::System.Convert.ToString); + } + if (content.Contains("EtcdInfoVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).EtcdInfoVersion = (string) content.GetValueForProperty("EtcdInfoVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).EtcdInfoVersion, 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 KubernetesClusterInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EtcdInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).EtcdInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfo) content.GetValueForProperty("EtcdInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).EtcdInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EtcdInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Node")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).Node = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo[]) content.GetValueForProperty("Node",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).Node, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodeInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("EtcdInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).EtcdInfoType = (string) content.GetValueForProperty("EtcdInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).EtcdInfoType, global::System.Convert.ToString); + } + if (content.Contains("EtcdInfoVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).EtcdInfoVersion = (string) content.GetValueForProperty("EtcdInfoVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)this).EtcdInfoVersion, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Kubernetes cluster configuration + [System.ComponentModel.TypeConverter(typeof(KubernetesClusterInfoTypeConverter))] + public partial interface IKubernetesClusterInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesClusterInfo.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesClusterInfo.TypeConverter.cs new file mode 100644 index 000000000000..6def96fe66f1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesClusterInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KubernetesClusterInfoTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KubernetesClusterInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KubernetesClusterInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KubernetesClusterInfo.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/databoxedge/generated/api/Models/Api20220301/KubernetesClusterInfo.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesClusterInfo.cs new file mode 100644 index 000000000000..d90342cd72fb --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesClusterInfo.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Kubernetes cluster configuration + public partial class KubernetesClusterInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfo _etcdInfo; + + /// Etcd configuration + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfo EtcdInfo { get => (this._etcdInfo = this._etcdInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EtcdInfo()); } + + /// Etcd type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string EtcdInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfoInternal)EtcdInfo).Type; } + + /// Etcd version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string EtcdInfoVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfoInternal)EtcdInfo).Version; } + + /// Internal Acessors for EtcdInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal.EtcdInfo { get => (this._etcdInfo = this._etcdInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EtcdInfo()); set { {_etcdInfo = value;} } } + + /// Internal Acessors for EtcdInfoType + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal.EtcdInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfoInternal)EtcdInfo).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfoInternal)EtcdInfo).Type = value; } + + /// Internal Acessors for EtcdInfoVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal.EtcdInfoVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfoInternal)EtcdInfo).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfoInternal)EtcdInfo).Version = value; } + + /// Internal Acessors for Node + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal.Node { get => this._node; set { {_node = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo[] _node; + + /// Kubernetes cluster nodes + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo[] Node { get => this._node; } + + /// Backing field for property. + private string _version; + + /// Kubernetes cluster version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Version { get => this._version; set => this._version = value; } + + /// Creates an new instance. + public KubernetesClusterInfo() + { + + } + } + /// Kubernetes cluster configuration + public partial interface IKubernetesClusterInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Etcd type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Etcd type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string EtcdInfoType { get; } + /// Etcd version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Etcd version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string EtcdInfoVersion { get; } + /// Kubernetes cluster nodes + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Kubernetes cluster nodes", + SerializedName = @"nodes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo[] Node { get; } + /// Kubernetes cluster version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Kubernetes cluster version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; set; } + + } + /// Kubernetes cluster configuration + internal partial interface IKubernetesClusterInfoInternal + + { + /// Etcd configuration + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfo EtcdInfo { get; set; } + /// Etcd type + string EtcdInfoType { get; set; } + /// Etcd version + string EtcdInfoVersion { get; set; } + /// Kubernetes cluster nodes + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo[] Node { get; set; } + /// Kubernetes cluster version + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesClusterInfo.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesClusterInfo.json.cs new file mode 100644 index 000000000000..0ffec61736f5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesClusterInfo.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Kubernetes cluster configuration + public partial class KubernetesClusterInfo + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new KubernetesClusterInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal KubernetesClusterInfo(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_etcdInfo = If( json?.PropertyT("etcdInfo"), out var __jsonEtcdInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EtcdInfo.FromJson(__jsonEtcdInfo) : EtcdInfo;} + {_node = If( json?.PropertyT("nodes"), out var __jsonNodes) ? If( __jsonNodes as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.INodeInfo) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodeInfo.FromJson(__u) )) ))() : null : Node;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._etcdInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._etcdInfo.ToJson(null,serializationMode) : null, "etcdInfo" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._node) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._node ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("nodes",__w); + } + } + AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesIPConfiguration.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesIPConfiguration.PowerShell.cs new file mode 100644 index 000000000000..99fabb6d3f4d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesIPConfiguration.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Kubernetes node IP configuration + [System.ComponentModel.TypeConverter(typeof(KubernetesIPConfigurationTypeConverter))] + public partial class KubernetesIPConfiguration + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IKubernetesIPConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesIPConfiguration(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.DataBoxEdge.Models.Api20220301.IKubernetesIPConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesIPConfiguration(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.DataBoxEdge.Models.Api20220301.IKubernetesIPConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesIPConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfigurationInternal)this).Port = (string) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfigurationInternal)this).Port, global::System.Convert.ToString); + } + if (content.Contains("IPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfigurationInternal)this).IPAddress = (string) content.GetValueForProperty("IPAddress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfigurationInternal)this).IPAddress, 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 KubernetesIPConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfigurationInternal)this).Port = (string) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfigurationInternal)this).Port, global::System.Convert.ToString); + } + if (content.Contains("IPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfigurationInternal)this).IPAddress = (string) content.GetValueForProperty("IPAddress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfigurationInternal)this).IPAddress, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Kubernetes node IP configuration + [System.ComponentModel.TypeConverter(typeof(KubernetesIPConfigurationTypeConverter))] + public partial interface IKubernetesIPConfiguration + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesIPConfiguration.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesIPConfiguration.TypeConverter.cs new file mode 100644 index 000000000000..f0a906fa242f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesIPConfiguration.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KubernetesIPConfigurationTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IKubernetesIPConfiguration ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfiguration).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KubernetesIPConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KubernetesIPConfiguration.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KubernetesIPConfiguration.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/databoxedge/generated/api/Models/Api20220301/KubernetesIPConfiguration.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesIPConfiguration.cs new file mode 100644 index 000000000000..ebc2705595b4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesIPConfiguration.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Kubernetes node IP configuration + public partial class KubernetesIPConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfigurationInternal + { + + /// Backing field for property. + private string _iPAddress; + + /// IP address of the Kubernetes node. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string IPAddress { get => this._iPAddress; set => this._iPAddress = value; } + + /// Internal Acessors for Port + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfigurationInternal.Port { get => this._port; set { {_port = value;} } } + + /// Backing field for property. + private string _port; + + /// Port of the Kubernetes node. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Port { get => this._port; } + + /// Creates an new instance. + public KubernetesIPConfiguration() + { + + } + } + /// Kubernetes node IP configuration + public partial interface IKubernetesIPConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// IP address of the Kubernetes node. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"IP address of the Kubernetes node.", + SerializedName = @"ipAddress", + PossibleTypes = new [] { typeof(string) })] + string IPAddress { get; set; } + /// Port of the Kubernetes node. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Port of the Kubernetes node.", + SerializedName = @"port", + PossibleTypes = new [] { typeof(string) })] + string Port { get; } + + } + /// Kubernetes node IP configuration + internal partial interface IKubernetesIPConfigurationInternal + + { + /// IP address of the Kubernetes node. + string IPAddress { get; set; } + /// Port of the Kubernetes node. + string Port { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesIPConfiguration.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesIPConfiguration.json.cs new file mode 100644 index 000000000000..0e647223251d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesIPConfiguration.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Kubernetes node IP configuration + public partial class KubernetesIPConfiguration + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new KubernetesIPConfiguration(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal KubernetesIPConfiguration(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_port = If( json?.PropertyT("port"), out var __jsonPort) ? (string)__jsonPort : (string)Port;} + {_iPAddress = If( json?.PropertyT("ipAddress"), out var __jsonIPAddress) ? (string)__jsonIPAddress : (string)IPAddress;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._port)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._port.ToString()) : null, "port" ,container.Add ); + } + AddIf( null != (((object)this._iPAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._iPAddress.ToString()) : null, "ipAddress" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRole.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRole.PowerShell.cs new file mode 100644 index 000000000000..d0d3ffe44747 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRole.PowerShell.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// The limited preview of Kubernetes Cluster Management from the Azure supports: + /// 1. Using a simple turn-key option in Azure Portal, deploy a Kubernetes cluster on your Azure Stack Edge device. + /// 2. Configure Kubernetes cluster running on your device with Arc enabled Kubernetes with a click of a button in the Azure + /// Portal. + /// Azure Arc enables organizations to view, manage, and govern their on-premises Kubernetes clusters using the Azure Portal, + /// command line tools, and APIs. + /// 3. Easily configure Persistent Volumes using SMB and NFS shares for storing container data. + /// For more information, refer to the document here: https://databoxupdatepackages.blob.core.windows.net/documentation/Microsoft-Azure-Stack-Edge-K8-Cloud-Management-20210323.pdf + /// Or Demo: https://databoxupdatepackages.blob.core.windows.net/documentation/Microsoft-Azure-Stack-Edge-K8S-Cloud-Management-20210323.mp4 + /// By using this feature, you agree to the preview legal terms. See the https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/ + /// + [System.ComponentModel.TypeConverter(typeof(KubernetesRoleTypeConverter))] + public partial class KubernetesRole + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IKubernetesRole DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesRole(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.DataBoxEdge.Models.Api20220301.IKubernetesRole DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesRole(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.DataBoxEdge.Models.Api20220301.IKubernetesRole FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesRole(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.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRolePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes.CreateFrom); + } + if (content.Contains("RoleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).RoleStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) content.GetValueForProperty("RoleStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).RoleStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("KubernetesClusterInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KubernetesClusterInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfo) content.GetValueForProperty("KubernetesClusterInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KubernetesClusterInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesClusterInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).Resource = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResources) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).Resource, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleResourcesTypeConverter.ConvertFrom); + } + if (content.Contains("HostPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).HostPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType) content.GetValueForProperty("HostPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).HostPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType.CreateFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState.CreateFrom); + } + if (content.Contains("HostPlatformType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).HostPlatformType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType?) content.GetValueForProperty("HostPlatformType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).HostPlatformType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType.CreateFrom); + } + if (content.Contains("KuberneteClusterInfoEtcdInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteClusterInfoEtcdInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfo) content.GetValueForProperty("KuberneteClusterInfoEtcdInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteClusterInfoEtcdInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EtcdInfoTypeConverter.ConvertFrom); + } + if (content.Contains("KuberneteClusterInfoNode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteClusterInfoNode = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo[]) content.GetValueForProperty("KuberneteClusterInfoNode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteClusterInfoNode, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodeInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("KuberneteClusterInfoVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteClusterInfoVersion = (string) content.GetValueForProperty("KuberneteClusterInfoVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteClusterInfoVersion, global::System.Convert.ToString); + } + if (content.Contains("EtcdInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).EtcdInfoType = (string) content.GetValueForProperty("EtcdInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).EtcdInfoType, global::System.Convert.ToString); + } + if (content.Contains("EtcdInfoVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).EtcdInfoVersion = (string) content.GetValueForProperty("EtcdInfoVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).EtcdInfoVersion, global::System.Convert.ToString); + } + if (content.Contains("KuberneteRoleResourceStorage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteRoleResourceStorage = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage) content.GetValueForProperty("KuberneteRoleResourceStorage",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteRoleResourceStorage, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorageTypeConverter.ConvertFrom); + } + if (content.Contains("KuberneteRoleResourceCompute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteRoleResourceCompute = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute) content.GetValueForProperty("KuberneteRoleResourceCompute",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteRoleResourceCompute, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleComputeTypeConverter.ConvertFrom); + } + if (content.Contains("KuberneteRoleResourceNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteRoleResourceNetwork = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork) content.GetValueForProperty("KuberneteRoleResourceNetwork",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteRoleResourceNetwork, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleNetworkTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkCniConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).NetworkCniConfig = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig) content.GetValueForProperty("NetworkCniConfig",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).NetworkCniConfig, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CniConfigTypeConverter.ConvertFrom); + } + if (content.Contains("StorageClass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).StorageClass = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[]) content.GetValueForProperty("StorageClass",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).StorageClass, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorageClassInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("StorageEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).StorageEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[]) content.GetValueForProperty("StorageEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).StorageEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMapTypeConverter.ConvertFrom)); + } + if (content.Contains("ComputeVMProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).ComputeVMProfile = (string) content.GetValueForProperty("ComputeVMProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).ComputeVMProfile, global::System.Convert.ToString); + } + if (content.Contains("ComputeMemoryInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).ComputeMemoryInByte = (long?) content.GetValueForProperty("ComputeMemoryInByte",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).ComputeMemoryInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ComputeProcessorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).ComputeProcessorCount = (int?) content.GetValueForProperty("ComputeProcessorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).ComputeProcessorCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetworkLoadBalancerConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).NetworkLoadBalancerConfig = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig) content.GetValueForProperty("NetworkLoadBalancerConfig",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).NetworkLoadBalancerConfig, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.LoadBalancerConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CniConfigType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).CniConfigType = (string) content.GetValueForProperty("CniConfigType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).CniConfigType, global::System.Convert.ToString); + } + if (content.Contains("CniConfigVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).CniConfigVersion = (string) content.GetValueForProperty("CniConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).CniConfigVersion, global::System.Convert.ToString); + } + if (content.Contains("CniConfigPodSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).CniConfigPodSubnet = (string) content.GetValueForProperty("CniConfigPodSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).CniConfigPodSubnet, global::System.Convert.ToString); + } + if (content.Contains("CniConfigServiceSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).CniConfigServiceSubnet = (string) content.GetValueForProperty("CniConfigServiceSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).CniConfigServiceSubnet, global::System.Convert.ToString); + } + if (content.Contains("LoadBalancerConfigType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).LoadBalancerConfigType = (string) content.GetValueForProperty("LoadBalancerConfigType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).LoadBalancerConfigType, global::System.Convert.ToString); + } + if (content.Contains("LoadBalancerConfigVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).LoadBalancerConfigVersion = (string) content.GetValueForProperty("LoadBalancerConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).LoadBalancerConfigVersion, 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 KubernetesRole(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.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRolePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes.CreateFrom); + } + if (content.Contains("RoleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).RoleStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) content.GetValueForProperty("RoleStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).RoleStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("KubernetesClusterInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KubernetesClusterInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfo) content.GetValueForProperty("KubernetesClusterInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KubernetesClusterInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesClusterInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).Resource = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResources) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).Resource, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleResourcesTypeConverter.ConvertFrom); + } + if (content.Contains("HostPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).HostPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType) content.GetValueForProperty("HostPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).HostPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType.CreateFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState.CreateFrom); + } + if (content.Contains("HostPlatformType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).HostPlatformType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType?) content.GetValueForProperty("HostPlatformType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).HostPlatformType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType.CreateFrom); + } + if (content.Contains("KuberneteClusterInfoEtcdInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteClusterInfoEtcdInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfo) content.GetValueForProperty("KuberneteClusterInfoEtcdInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteClusterInfoEtcdInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EtcdInfoTypeConverter.ConvertFrom); + } + if (content.Contains("KuberneteClusterInfoNode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteClusterInfoNode = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo[]) content.GetValueForProperty("KuberneteClusterInfoNode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteClusterInfoNode, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodeInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("KuberneteClusterInfoVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteClusterInfoVersion = (string) content.GetValueForProperty("KuberneteClusterInfoVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteClusterInfoVersion, global::System.Convert.ToString); + } + if (content.Contains("EtcdInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).EtcdInfoType = (string) content.GetValueForProperty("EtcdInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).EtcdInfoType, global::System.Convert.ToString); + } + if (content.Contains("EtcdInfoVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).EtcdInfoVersion = (string) content.GetValueForProperty("EtcdInfoVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).EtcdInfoVersion, global::System.Convert.ToString); + } + if (content.Contains("KuberneteRoleResourceStorage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteRoleResourceStorage = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage) content.GetValueForProperty("KuberneteRoleResourceStorage",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteRoleResourceStorage, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorageTypeConverter.ConvertFrom); + } + if (content.Contains("KuberneteRoleResourceCompute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteRoleResourceCompute = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute) content.GetValueForProperty("KuberneteRoleResourceCompute",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteRoleResourceCompute, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleComputeTypeConverter.ConvertFrom); + } + if (content.Contains("KuberneteRoleResourceNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteRoleResourceNetwork = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork) content.GetValueForProperty("KuberneteRoleResourceNetwork",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).KuberneteRoleResourceNetwork, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleNetworkTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkCniConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).NetworkCniConfig = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig) content.GetValueForProperty("NetworkCniConfig",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).NetworkCniConfig, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CniConfigTypeConverter.ConvertFrom); + } + if (content.Contains("StorageClass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).StorageClass = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[]) content.GetValueForProperty("StorageClass",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).StorageClass, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorageClassInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("StorageEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).StorageEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[]) content.GetValueForProperty("StorageEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).StorageEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMapTypeConverter.ConvertFrom)); + } + if (content.Contains("ComputeVMProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).ComputeVMProfile = (string) content.GetValueForProperty("ComputeVMProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).ComputeVMProfile, global::System.Convert.ToString); + } + if (content.Contains("ComputeMemoryInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).ComputeMemoryInByte = (long?) content.GetValueForProperty("ComputeMemoryInByte",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).ComputeMemoryInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ComputeProcessorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).ComputeProcessorCount = (int?) content.GetValueForProperty("ComputeProcessorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).ComputeProcessorCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetworkLoadBalancerConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).NetworkLoadBalancerConfig = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig) content.GetValueForProperty("NetworkLoadBalancerConfig",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).NetworkLoadBalancerConfig, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.LoadBalancerConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CniConfigType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).CniConfigType = (string) content.GetValueForProperty("CniConfigType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).CniConfigType, global::System.Convert.ToString); + } + if (content.Contains("CniConfigVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).CniConfigVersion = (string) content.GetValueForProperty("CniConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).CniConfigVersion, global::System.Convert.ToString); + } + if (content.Contains("CniConfigPodSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).CniConfigPodSubnet = (string) content.GetValueForProperty("CniConfigPodSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).CniConfigPodSubnet, global::System.Convert.ToString); + } + if (content.Contains("CniConfigServiceSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).CniConfigServiceSubnet = (string) content.GetValueForProperty("CniConfigServiceSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).CniConfigServiceSubnet, global::System.Convert.ToString); + } + if (content.Contains("LoadBalancerConfigType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).LoadBalancerConfigType = (string) content.GetValueForProperty("LoadBalancerConfigType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).LoadBalancerConfigType, global::System.Convert.ToString); + } + if (content.Contains("LoadBalancerConfigVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).LoadBalancerConfigVersion = (string) content.GetValueForProperty("LoadBalancerConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal)this).LoadBalancerConfigVersion, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The limited preview of Kubernetes Cluster Management from the Azure supports: + /// 1. Using a simple turn-key option in Azure Portal, deploy a Kubernetes cluster on your Azure Stack Edge device. + /// 2. Configure Kubernetes cluster running on your device with Arc enabled Kubernetes with a click of a button in the Azure + /// Portal. + /// Azure Arc enables organizations to view, manage, and govern their on-premises Kubernetes clusters using the Azure Portal, + /// command line tools, and APIs. + /// 3. Easily configure Persistent Volumes using SMB and NFS shares for storing container data. + /// For more information, refer to the document here: https://databoxupdatepackages.blob.core.windows.net/documentation/Microsoft-Azure-Stack-Edge-K8-Cloud-Management-20210323.pdf + /// Or Demo: https://databoxupdatepackages.blob.core.windows.net/documentation/Microsoft-Azure-Stack-Edge-K8S-Cloud-Management-20210323.mp4 + /// By using this feature, you agree to the preview legal terms. See the https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/ + [System.ComponentModel.TypeConverter(typeof(KubernetesRoleTypeConverter))] + public partial interface IKubernetesRole + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRole.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRole.TypeConverter.cs new file mode 100644 index 000000000000..1d9376b9818b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRole.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KubernetesRoleTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IKubernetesRole ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRole).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KubernetesRole.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KubernetesRole.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KubernetesRole.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/databoxedge/generated/api/Models/Api20220301/KubernetesRole.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRole.cs new file mode 100644 index 000000000000..df0023eb58a7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRole.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// The limited preview of Kubernetes Cluster Management from the Azure supports: + /// 1. Using a simple turn-key option in Azure Portal, deploy a Kubernetes cluster on your Azure Stack Edge device. + /// 2. Configure Kubernetes cluster running on your device with Arc enabled Kubernetes with a click of a button in the Azure + /// Portal. + /// Azure Arc enables organizations to view, manage, and govern their on-premises Kubernetes clusters using the Azure Portal, + /// command line tools, and APIs. + /// 3. Easily configure Persistent Volumes using SMB and NFS shares for storing container data. + /// For more information, refer to the document here: https://databoxupdatepackages.blob.core.windows.net/documentation/Microsoft-Azure-Stack-Edge-K8-Cloud-Management-20210323.pdf + /// Or Demo: https://databoxupdatepackages.blob.core.windows.net/documentation/Microsoft-Azure-Stack-Edge-K8S-Cloud-Management-20210323.mp4 + /// By using this feature, you agree to the preview legal terms. See the https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/ + /// + public partial class KubernetesRole : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRole, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole __role = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Role(); + + /// Pod Subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CniConfigPodSubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).CniConfigPodSubnet; } + + /// Service subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CniConfigServiceSubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).CniConfigServiceSubnet; } + + /// Cni type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CniConfigType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).CniConfigType; } + + /// Cni version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CniConfigVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).CniConfigVersion; } + + /// Memory in bytes + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public long? ComputeMemoryInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).ComputeMemoryInByte; } + + /// Processor count + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? ComputeProcessorCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).ComputeProcessorCount; } + + /// VM profile + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ComputeVMProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).ComputeVMProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).ComputeVMProfile = value ?? null; } + + /// Etcd type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string EtcdInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).EtcdInfoType; } + + /// Etcd version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string EtcdInfoVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).EtcdInfoVersion; } + + /// Host OS supported by the Kubernetes role. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? HostPlatform { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).HostPlatform; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).HostPlatform = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType)""); } + + /// Platform where the runtime is hosted. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).HostPlatformType; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Id; } + + /// Role type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).Kind = value ; } + + /// Kubernetes cluster nodes + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo[] KuberneteClusterInfoNode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).KuberneteClusterInfoNode; } + + /// Kubernetes cluster version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string KuberneteClusterInfoVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).KuberneteClusterInfoVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).KuberneteClusterInfoVersion = value ?? null; } + + /// Load balancer type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string LoadBalancerConfigType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).LoadBalancerConfigType; } + + /// Load balancer version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string LoadBalancerConfigVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).LoadBalancerConfigVersion; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Type = value; } + + /// Internal Acessors for CniConfigPodSubnet + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.CniConfigPodSubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).CniConfigPodSubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).CniConfigPodSubnet = value; } + + /// Internal Acessors for CniConfigServiceSubnet + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.CniConfigServiceSubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).CniConfigServiceSubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).CniConfigServiceSubnet = value; } + + /// Internal Acessors for CniConfigType + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.CniConfigType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).CniConfigType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).CniConfigType = value; } + + /// Internal Acessors for CniConfigVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.CniConfigVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).CniConfigVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).CniConfigVersion = value; } + + /// Internal Acessors for ComputeMemoryInByte + long? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.ComputeMemoryInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).ComputeMemoryInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).ComputeMemoryInByte = value; } + + /// Internal Acessors for ComputeProcessorCount + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.ComputeProcessorCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).ComputeProcessorCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).ComputeProcessorCount = value; } + + /// Internal Acessors for EtcdInfoType + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.EtcdInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).EtcdInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).EtcdInfoType = value; } + + /// Internal Acessors for EtcdInfoVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.EtcdInfoVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).EtcdInfoVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).EtcdInfoVersion = value; } + + /// Internal Acessors for HostPlatformType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.HostPlatformType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).HostPlatformType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).HostPlatformType = value; } + + /// Internal Acessors for KuberneteClusterInfoEtcdInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.KuberneteClusterInfoEtcdInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).KuberneteClusterInfoEtcdInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).KuberneteClusterInfoEtcdInfo = value; } + + /// Internal Acessors for KuberneteClusterInfoNode + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.KuberneteClusterInfoNode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).KuberneteClusterInfoNode; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).KuberneteClusterInfoNode = value; } + + /// Internal Acessors for KuberneteRoleResourceCompute + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.KuberneteRoleResourceCompute { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).KuberneteRoleResourceCompute; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).KuberneteRoleResourceCompute = value; } + + /// Internal Acessors for KuberneteRoleResourceNetwork + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.KuberneteRoleResourceNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).KuberneteRoleResourceNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).KuberneteRoleResourceNetwork = value; } + + /// Internal Acessors for KuberneteRoleResourceStorage + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.KuberneteRoleResourceStorage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).KuberneteRoleResourceStorage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).KuberneteRoleResourceStorage = value; } + + /// Internal Acessors for KubernetesClusterInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.KubernetesClusterInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).KubernetesClusterInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).KubernetesClusterInfo = value; } + + /// Internal Acessors for LoadBalancerConfigType + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.LoadBalancerConfigType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).LoadBalancerConfigType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).LoadBalancerConfigType = value; } + + /// Internal Acessors for LoadBalancerConfigVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.LoadBalancerConfigVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).LoadBalancerConfigVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).LoadBalancerConfigVersion = value; } + + /// Internal Acessors for NetworkCniConfig + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.NetworkCniConfig { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).NetworkCniConfig; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).NetworkCniConfig = value; } + + /// Internal Acessors for NetworkLoadBalancerConfig + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.NetworkLoadBalancerConfig { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).NetworkLoadBalancerConfig; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).NetworkLoadBalancerConfig = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for Resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResources Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.Resource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).KubernetesRoleResource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).KubernetesRoleResource = value; } + + /// Internal Acessors for StorageClass + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleInternal.StorageClass { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).StorageClass; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).StorageClass = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemData = value; } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleProperties _property; + + /// Properties specific to Kubernetes role. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleProperties()); set => this._property = value; } + + /// State of Kubernetes deployment + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).ProvisioningState; } + + /// Role status. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? RoleStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).RoleStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).RoleStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus)""); } + + /// Kubernetes storage class info. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[] StorageClass { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).StorageClass; } + + /// Mount points of shares in role(s). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] StorageEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).StorageEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)Property).StorageEndpoint = value ?? null /* arrayOf */; } + + /// Metadata pertaining to creation and last modification of Role + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Type; } + + /// Creates an new instance. + public KubernetesRole() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__role), __role); + await eventListener.AssertObjectIsValid(nameof(__role), __role); + } + } + /// The limited preview of Kubernetes Cluster Management from the Azure supports: + /// 1. Using a simple turn-key option in Azure Portal, deploy a Kubernetes cluster on your Azure Stack Edge device. + /// 2. Configure Kubernetes cluster running on your device with Arc enabled Kubernetes with a click of a button in the Azure + /// Portal. + /// Azure Arc enables organizations to view, manage, and govern their on-premises Kubernetes clusters using the Azure Portal, + /// command line tools, and APIs. + /// 3. Easily configure Persistent Volumes using SMB and NFS shares for storing container data. + /// For more information, refer to the document here: https://databoxupdatepackages.blob.core.windows.net/documentation/Microsoft-Azure-Stack-Edge-K8-Cloud-Management-20210323.pdf + /// Or Demo: https://databoxupdatepackages.blob.core.windows.net/documentation/Microsoft-Azure-Stack-Edge-K8S-Cloud-Management-20210323.mp4 + /// By using this feature, you agree to the preview legal terms. See the https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/ + public partial interface IKubernetesRole : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole + { + /// Pod Subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Pod Subnet", + SerializedName = @"podSubnet", + PossibleTypes = new [] { typeof(string) })] + string CniConfigPodSubnet { get; } + /// Service subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Service subnet", + SerializedName = @"serviceSubnet", + PossibleTypes = new [] { typeof(string) })] + string CniConfigServiceSubnet { get; } + /// Cni type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Cni type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string CniConfigType { get; } + /// Cni version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Cni version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string CniConfigVersion { get; } + /// Memory in bytes + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Memory in bytes", + SerializedName = @"memoryInBytes", + PossibleTypes = new [] { typeof(long) })] + long? ComputeMemoryInByte { get; } + /// Processor count + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Processor count", + SerializedName = @"processorCount", + PossibleTypes = new [] { typeof(int) })] + int? ComputeProcessorCount { get; } + /// VM profile + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"VM profile", + SerializedName = @"vmProfile", + PossibleTypes = new [] { typeof(string) })] + string ComputeVMProfile { get; set; } + /// Etcd type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Etcd type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string EtcdInfoType { get; } + /// Etcd version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Etcd version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string EtcdInfoVersion { get; } + /// Host OS supported by the Kubernetes role. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Host OS supported by the Kubernetes role.", + SerializedName = @"hostPlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? HostPlatform { get; set; } + /// Platform where the runtime is hosted. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Platform where the runtime is hosted.", + SerializedName = @"hostPlatformType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get; } + /// Kubernetes cluster nodes + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Kubernetes cluster nodes", + SerializedName = @"nodes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo[] KuberneteClusterInfoNode { get; } + /// Kubernetes cluster version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Kubernetes cluster version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string KuberneteClusterInfoVersion { get; set; } + /// Load balancer type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Load balancer type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string LoadBalancerConfigType { get; } + /// Load balancer version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Load balancer version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string LoadBalancerConfigVersion { get; } + /// State of Kubernetes deployment + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"State of Kubernetes deployment", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState? ProvisioningState { get; } + /// Role status. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Role status.", + SerializedName = @"roleStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? RoleStatus { get; set; } + /// Kubernetes storage class info. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Kubernetes storage class info.", + SerializedName = @"storageClasses", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[] StorageClass { get; } + /// Mount points of shares in role(s). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mount points of shares in role(s).", + SerializedName = @"endpoints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] StorageEndpoint { get; set; } + + } + /// The limited preview of Kubernetes Cluster Management from the Azure supports: + /// 1. Using a simple turn-key option in Azure Portal, deploy a Kubernetes cluster on your Azure Stack Edge device. + /// 2. Configure Kubernetes cluster running on your device with Arc enabled Kubernetes with a click of a button in the Azure + /// Portal. + /// Azure Arc enables organizations to view, manage, and govern their on-premises Kubernetes clusters using the Azure Portal, + /// command line tools, and APIs. + /// 3. Easily configure Persistent Volumes using SMB and NFS shares for storing container data. + /// For more information, refer to the document here: https://databoxupdatepackages.blob.core.windows.net/documentation/Microsoft-Azure-Stack-Edge-K8-Cloud-Management-20210323.pdf + /// Or Demo: https://databoxupdatepackages.blob.core.windows.net/documentation/Microsoft-Azure-Stack-Edge-K8S-Cloud-Management-20210323.mp4 + /// By using this feature, you agree to the preview legal terms. See the https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/ + internal partial interface IKubernetesRoleInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal + { + /// Pod Subnet + string CniConfigPodSubnet { get; set; } + /// Service subnet + string CniConfigServiceSubnet { get; set; } + /// Cni type + string CniConfigType { get; set; } + /// Cni version + string CniConfigVersion { get; set; } + /// Memory in bytes + long? ComputeMemoryInByte { get; set; } + /// Processor count + int? ComputeProcessorCount { get; set; } + /// VM profile + string ComputeVMProfile { get; set; } + /// Etcd type + string EtcdInfoType { get; set; } + /// Etcd version + string EtcdInfoVersion { get; set; } + /// Host OS supported by the Kubernetes role. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType? HostPlatform { get; set; } + /// Platform where the runtime is hosted. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get; set; } + /// Etcd configuration + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfo KuberneteClusterInfoEtcdInfo { get; set; } + /// Kubernetes cluster nodes + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo[] KuberneteClusterInfoNode { get; set; } + /// Kubernetes cluster version + string KuberneteClusterInfoVersion { get; set; } + /// Kubernetes role compute resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute KuberneteRoleResourceCompute { get; set; } + /// Kubernetes role network resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork KuberneteRoleResourceNetwork { get; set; } + /// Kubernetes role storage resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage KuberneteRoleResourceStorage { get; set; } + /// Kubernetes cluster configuration + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfo KubernetesClusterInfo { get; set; } + /// Load balancer type + string LoadBalancerConfigType { get; set; } + /// Load balancer version + string LoadBalancerConfigVersion { get; set; } + /// Cni configuration + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig NetworkCniConfig { get; set; } + /// Load balancer configuration + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig NetworkLoadBalancerConfig { get; set; } + /// Properties specific to Kubernetes role. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleProperties Property { get; set; } + /// State of Kubernetes deployment + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState? ProvisioningState { get; set; } + /// Kubernetes role resources + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResources Resource { get; set; } + /// Role status. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? RoleStatus { get; set; } + /// Kubernetes storage class info. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[] StorageClass { get; set; } + /// Mount points of shares in role(s). + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] StorageEndpoint { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRole.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRole.json.cs new file mode 100644 index 000000000000..96df4e375211 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRole.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// The limited preview of Kubernetes Cluster Management from the Azure supports: + /// 1. Using a simple turn-key option in Azure Portal, deploy a Kubernetes cluster on your Azure Stack Edge device. + /// 2. Configure Kubernetes cluster running on your device with Arc enabled Kubernetes with a click of a button in the Azure + /// Portal. + /// Azure Arc enables organizations to view, manage, and govern their on-premises Kubernetes clusters using the Azure Portal, + /// command line tools, and APIs. + /// 3. Easily configure Persistent Volumes using SMB and NFS shares for storing container data. + /// For more information, refer to the document here: https://databoxupdatepackages.blob.core.windows.net/documentation/Microsoft-Azure-Stack-Edge-K8-Cloud-Management-20210323.pdf + /// Or Demo: https://databoxupdatepackages.blob.core.windows.net/documentation/Microsoft-Azure-Stack-Edge-K8S-Cloud-Management-20210323.mp4 + /// By using this feature, you agree to the preview legal terms. See the https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/ + /// + public partial class KubernetesRole + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRole. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRole. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRole FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new KubernetesRole(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal KubernetesRole(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __role = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Role(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleProperties.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __role?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/KubernetesRoleCompute.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleCompute.PowerShell.cs new file mode 100644 index 000000000000..5c0a4f7a0dee --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleCompute.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Kubernetes role compute resource + [System.ComponentModel.TypeConverter(typeof(KubernetesRoleComputeTypeConverter))] + public partial class KubernetesRoleCompute + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesRoleCompute(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.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesRoleCompute(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.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesRoleCompute(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("VMProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)this).VMProfile = (string) content.GetValueForProperty("VMProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)this).VMProfile, global::System.Convert.ToString); + } + if (content.Contains("MemoryInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)this).MemoryInByte = (long?) content.GetValueForProperty("MemoryInByte",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)this).MemoryInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ProcessorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)this).ProcessorCount = (int?) content.GetValueForProperty("ProcessorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)this).ProcessorCount, (__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 KubernetesRoleCompute(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("VMProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)this).VMProfile = (string) content.GetValueForProperty("VMProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)this).VMProfile, global::System.Convert.ToString); + } + if (content.Contains("MemoryInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)this).MemoryInByte = (long?) content.GetValueForProperty("MemoryInByte",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)this).MemoryInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ProcessorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)this).ProcessorCount = (int?) content.GetValueForProperty("ProcessorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)this).ProcessorCount, (__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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Kubernetes role compute resource + [System.ComponentModel.TypeConverter(typeof(KubernetesRoleComputeTypeConverter))] + public partial interface IKubernetesRoleCompute + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleCompute.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleCompute.TypeConverter.cs new file mode 100644 index 000000000000..d4ce59a45a7b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleCompute.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KubernetesRoleComputeTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KubernetesRoleCompute.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KubernetesRoleCompute.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KubernetesRoleCompute.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/databoxedge/generated/api/Models/Api20220301/KubernetesRoleCompute.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleCompute.cs new file mode 100644 index 000000000000..626b33eb20bc --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleCompute.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Kubernetes role compute resource + public partial class KubernetesRoleCompute : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal + { + + /// Backing field for property. + private long? _memoryInByte; + + /// Memory in bytes + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public long? MemoryInByte { get => this._memoryInByte; } + + /// Internal Acessors for MemoryInByte + long? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal.MemoryInByte { get => this._memoryInByte; set { {_memoryInByte = value;} } } + + /// Internal Acessors for ProcessorCount + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal.ProcessorCount { get => this._processorCount; set { {_processorCount = value;} } } + + /// Backing field for property. + private int? _processorCount; + + /// Processor count + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? ProcessorCount { get => this._processorCount; } + + /// Backing field for property. + private string _vMProfile; + + /// VM profile + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string VMProfile { get => this._vMProfile; set => this._vMProfile = value; } + + /// Creates an new instance. + public KubernetesRoleCompute() + { + + } + } + /// Kubernetes role compute resource + public partial interface IKubernetesRoleCompute : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Memory in bytes + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Memory in bytes", + SerializedName = @"memoryInBytes", + PossibleTypes = new [] { typeof(long) })] + long? MemoryInByte { get; } + /// Processor count + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Processor count", + SerializedName = @"processorCount", + PossibleTypes = new [] { typeof(int) })] + int? ProcessorCount { get; } + /// VM profile + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"VM profile", + SerializedName = @"vmProfile", + PossibleTypes = new [] { typeof(string) })] + string VMProfile { get; set; } + + } + /// Kubernetes role compute resource + internal partial interface IKubernetesRoleComputeInternal + + { + /// Memory in bytes + long? MemoryInByte { get; set; } + /// Processor count + int? ProcessorCount { get; set; } + /// VM profile + string VMProfile { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleCompute.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleCompute.json.cs new file mode 100644 index 000000000000..27fd29818ab2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleCompute.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Kubernetes role compute resource + public partial class KubernetesRoleCompute + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new KubernetesRoleCompute(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal KubernetesRoleCompute(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_vMProfile = If( json?.PropertyT("vmProfile"), out var __jsonVMProfile) ? (string)__jsonVMProfile : (string)VMProfile;} + {_memoryInByte = If( json?.PropertyT("memoryInBytes"), out var __jsonMemoryInBytes) ? (long?)__jsonMemoryInBytes : MemoryInByte;} + {_processorCount = If( json?.PropertyT("processorCount"), out var __jsonProcessorCount) ? (int?)__jsonProcessorCount : ProcessorCount;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._vMProfile)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._vMProfile.ToString()) : null, "vmProfile" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._memoryInByte ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((long)this._memoryInByte) : null, "memoryInBytes" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._processorCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._processorCount) : null, "processorCount" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleNetwork.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleNetwork.PowerShell.cs new file mode 100644 index 000000000000..26b3d00406c1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleNetwork.PowerShell.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Kubernetes role network resource + [System.ComponentModel.TypeConverter(typeof(KubernetesRoleNetworkTypeConverter))] + public partial class KubernetesRoleNetwork + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesRoleNetwork(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.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesRoleNetwork(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.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesRoleNetwork(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CniConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfig = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig) content.GetValueForProperty("CniConfig",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfig, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CniConfigTypeConverter.ConvertFrom); + } + if (content.Contains("LoadBalancerConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).LoadBalancerConfig = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig) content.GetValueForProperty("LoadBalancerConfig",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).LoadBalancerConfig, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.LoadBalancerConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CniConfigType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfigType = (string) content.GetValueForProperty("CniConfigType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfigType, global::System.Convert.ToString); + } + if (content.Contains("CniConfigVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfigVersion = (string) content.GetValueForProperty("CniConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfigVersion, global::System.Convert.ToString); + } + if (content.Contains("CniConfigPodSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfigPodSubnet = (string) content.GetValueForProperty("CniConfigPodSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfigPodSubnet, global::System.Convert.ToString); + } + if (content.Contains("CniConfigServiceSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfigServiceSubnet = (string) content.GetValueForProperty("CniConfigServiceSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfigServiceSubnet, global::System.Convert.ToString); + } + if (content.Contains("LoadBalancerConfigType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).LoadBalancerConfigType = (string) content.GetValueForProperty("LoadBalancerConfigType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).LoadBalancerConfigType, global::System.Convert.ToString); + } + if (content.Contains("LoadBalancerConfigVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).LoadBalancerConfigVersion = (string) content.GetValueForProperty("LoadBalancerConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).LoadBalancerConfigVersion, 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 KubernetesRoleNetwork(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CniConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfig = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig) content.GetValueForProperty("CniConfig",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfig, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CniConfigTypeConverter.ConvertFrom); + } + if (content.Contains("LoadBalancerConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).LoadBalancerConfig = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig) content.GetValueForProperty("LoadBalancerConfig",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).LoadBalancerConfig, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.LoadBalancerConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CniConfigType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfigType = (string) content.GetValueForProperty("CniConfigType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfigType, global::System.Convert.ToString); + } + if (content.Contains("CniConfigVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfigVersion = (string) content.GetValueForProperty("CniConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfigVersion, global::System.Convert.ToString); + } + if (content.Contains("CniConfigPodSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfigPodSubnet = (string) content.GetValueForProperty("CniConfigPodSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfigPodSubnet, global::System.Convert.ToString); + } + if (content.Contains("CniConfigServiceSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfigServiceSubnet = (string) content.GetValueForProperty("CniConfigServiceSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).CniConfigServiceSubnet, global::System.Convert.ToString); + } + if (content.Contains("LoadBalancerConfigType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).LoadBalancerConfigType = (string) content.GetValueForProperty("LoadBalancerConfigType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).LoadBalancerConfigType, global::System.Convert.ToString); + } + if (content.Contains("LoadBalancerConfigVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).LoadBalancerConfigVersion = (string) content.GetValueForProperty("LoadBalancerConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)this).LoadBalancerConfigVersion, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Kubernetes role network resource + [System.ComponentModel.TypeConverter(typeof(KubernetesRoleNetworkTypeConverter))] + public partial interface IKubernetesRoleNetwork + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleNetwork.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleNetwork.TypeConverter.cs new file mode 100644 index 000000000000..76fbe815cef6 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleNetwork.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KubernetesRoleNetworkTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KubernetesRoleNetwork.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KubernetesRoleNetwork.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KubernetesRoleNetwork.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/databoxedge/generated/api/Models/Api20220301/KubernetesRoleNetwork.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleNetwork.cs new file mode 100644 index 000000000000..115923cbf610 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleNetwork.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Kubernetes role network resource + public partial class KubernetesRoleNetwork : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig _cniConfig; + + /// Cni configuration + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig CniConfig { get => (this._cniConfig = this._cniConfig ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CniConfig()); } + + /// Pod Subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CniConfigPodSubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)CniConfig).PodSubnet; } + + /// Service subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CniConfigServiceSubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)CniConfig).ServiceSubnet; } + + /// Cni type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CniConfigType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)CniConfig).Type; } + + /// Cni version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CniConfigVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)CniConfig).Version; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig _loadBalancerConfig; + + /// Load balancer configuration + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig LoadBalancerConfig { get => (this._loadBalancerConfig = this._loadBalancerConfig ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.LoadBalancerConfig()); } + + /// Load balancer type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string LoadBalancerConfigType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfigInternal)LoadBalancerConfig).Type; } + + /// Load balancer version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string LoadBalancerConfigVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfigInternal)LoadBalancerConfig).Version; } + + /// Internal Acessors for CniConfig + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal.CniConfig { get => (this._cniConfig = this._cniConfig ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CniConfig()); set { {_cniConfig = value;} } } + + /// Internal Acessors for CniConfigPodSubnet + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal.CniConfigPodSubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)CniConfig).PodSubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)CniConfig).PodSubnet = value; } + + /// Internal Acessors for CniConfigServiceSubnet + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal.CniConfigServiceSubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)CniConfig).ServiceSubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)CniConfig).ServiceSubnet = value; } + + /// Internal Acessors for CniConfigType + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal.CniConfigType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)CniConfig).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)CniConfig).Type = value; } + + /// Internal Acessors for CniConfigVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal.CniConfigVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)CniConfig).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfigInternal)CniConfig).Version = value; } + + /// Internal Acessors for LoadBalancerConfig + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal.LoadBalancerConfig { get => (this._loadBalancerConfig = this._loadBalancerConfig ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.LoadBalancerConfig()); set { {_loadBalancerConfig = value;} } } + + /// Internal Acessors for LoadBalancerConfigType + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal.LoadBalancerConfigType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfigInternal)LoadBalancerConfig).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfigInternal)LoadBalancerConfig).Type = value; } + + /// Internal Acessors for LoadBalancerConfigVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal.LoadBalancerConfigVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfigInternal)LoadBalancerConfig).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfigInternal)LoadBalancerConfig).Version = value; } + + /// Creates an new instance. + public KubernetesRoleNetwork() + { + + } + } + /// Kubernetes role network resource + public partial interface IKubernetesRoleNetwork : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Pod Subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Pod Subnet", + SerializedName = @"podSubnet", + PossibleTypes = new [] { typeof(string) })] + string CniConfigPodSubnet { get; } + /// Service subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Service subnet", + SerializedName = @"serviceSubnet", + PossibleTypes = new [] { typeof(string) })] + string CniConfigServiceSubnet { get; } + /// Cni type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Cni type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string CniConfigType { get; } + /// Cni version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Cni version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string CniConfigVersion { get; } + /// Load balancer type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Load balancer type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string LoadBalancerConfigType { get; } + /// Load balancer version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Load balancer version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string LoadBalancerConfigVersion { get; } + + } + /// Kubernetes role network resource + internal partial interface IKubernetesRoleNetworkInternal + + { + /// Cni configuration + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig CniConfig { get; set; } + /// Pod Subnet + string CniConfigPodSubnet { get; set; } + /// Service subnet + string CniConfigServiceSubnet { get; set; } + /// Cni type + string CniConfigType { get; set; } + /// Cni version + string CniConfigVersion { get; set; } + /// Load balancer configuration + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig LoadBalancerConfig { get; set; } + /// Load balancer type + string LoadBalancerConfigType { get; set; } + /// Load balancer version + string LoadBalancerConfigVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleNetwork.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleNetwork.json.cs new file mode 100644 index 000000000000..e140fc0e06f3 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleNetwork.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Kubernetes role network resource + public partial class KubernetesRoleNetwork + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new KubernetesRoleNetwork(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal KubernetesRoleNetwork(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_cniConfig = If( json?.PropertyT("cniConfig"), out var __jsonCniConfig) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CniConfig.FromJson(__jsonCniConfig) : CniConfig;} + {_loadBalancerConfig = If( json?.PropertyT("loadBalancerConfig"), out var __jsonLoadBalancerConfig) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.LoadBalancerConfig.FromJson(__jsonLoadBalancerConfig) : LoadBalancerConfig;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._cniConfig ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._cniConfig.ToJson(null,serializationMode) : null, "cniConfig" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._loadBalancerConfig ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._loadBalancerConfig.ToJson(null,serializationMode) : null, "loadBalancerConfig" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleProperties.PowerShell.cs new file mode 100644 index 000000000000..2105de23050c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Kubernetes role properties. + [System.ComponentModel.TypeConverter(typeof(KubernetesRolePropertiesTypeConverter))] + public partial class KubernetesRoleProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IKubernetesRoleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesRoleProperties(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.DataBoxEdge.Models.Api20220301.IKubernetesRoleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesRoleProperties(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.DataBoxEdge.Models.Api20220301.IKubernetesRoleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesRoleProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KubernetesClusterInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KubernetesClusterInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfo) content.GetValueForProperty("KubernetesClusterInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KubernetesClusterInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesClusterInfoTypeConverter.ConvertFrom); + } + if (content.Contains("KubernetesRoleResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KubernetesRoleResource = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResources) content.GetValueForProperty("KubernetesRoleResource",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KubernetesRoleResource, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleResourcesTypeConverter.ConvertFrom); + } + if (content.Contains("HostPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).HostPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType) content.GetValueForProperty("HostPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).HostPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType.CreateFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState.CreateFrom); + } + if (content.Contains("HostPlatformType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).HostPlatformType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType?) content.GetValueForProperty("HostPlatformType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).HostPlatformType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType.CreateFrom); + } + if (content.Contains("RoleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).RoleStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) content.GetValueForProperty("RoleStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).RoleStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("KuberneteClusterInfoEtcdInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteClusterInfoEtcdInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfo) content.GetValueForProperty("KuberneteClusterInfoEtcdInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteClusterInfoEtcdInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EtcdInfoTypeConverter.ConvertFrom); + } + if (content.Contains("KuberneteClusterInfoNode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteClusterInfoNode = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo[]) content.GetValueForProperty("KuberneteClusterInfoNode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteClusterInfoNode, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodeInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("KuberneteClusterInfoVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteClusterInfoVersion = (string) content.GetValueForProperty("KuberneteClusterInfoVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteClusterInfoVersion, global::System.Convert.ToString); + } + if (content.Contains("EtcdInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).EtcdInfoType = (string) content.GetValueForProperty("EtcdInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).EtcdInfoType, global::System.Convert.ToString); + } + if (content.Contains("EtcdInfoVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).EtcdInfoVersion = (string) content.GetValueForProperty("EtcdInfoVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).EtcdInfoVersion, global::System.Convert.ToString); + } + if (content.Contains("KuberneteRoleResourceStorage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteRoleResourceStorage = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage) content.GetValueForProperty("KuberneteRoleResourceStorage",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteRoleResourceStorage, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorageTypeConverter.ConvertFrom); + } + if (content.Contains("KuberneteRoleResourceCompute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteRoleResourceCompute = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute) content.GetValueForProperty("KuberneteRoleResourceCompute",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteRoleResourceCompute, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleComputeTypeConverter.ConvertFrom); + } + if (content.Contains("KuberneteRoleResourceNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteRoleResourceNetwork = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork) content.GetValueForProperty("KuberneteRoleResourceNetwork",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteRoleResourceNetwork, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleNetworkTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkCniConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).NetworkCniConfig = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig) content.GetValueForProperty("NetworkCniConfig",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).NetworkCniConfig, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CniConfigTypeConverter.ConvertFrom); + } + if (content.Contains("StorageClass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).StorageClass = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[]) content.GetValueForProperty("StorageClass",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).StorageClass, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorageClassInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("StorageEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).StorageEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[]) content.GetValueForProperty("StorageEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).StorageEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMapTypeConverter.ConvertFrom)); + } + if (content.Contains("ComputeVMProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).ComputeVMProfile = (string) content.GetValueForProperty("ComputeVMProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).ComputeVMProfile, global::System.Convert.ToString); + } + if (content.Contains("ComputeMemoryInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).ComputeMemoryInByte = (long?) content.GetValueForProperty("ComputeMemoryInByte",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).ComputeMemoryInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ComputeProcessorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).ComputeProcessorCount = (int?) content.GetValueForProperty("ComputeProcessorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).ComputeProcessorCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetworkLoadBalancerConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).NetworkLoadBalancerConfig = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig) content.GetValueForProperty("NetworkLoadBalancerConfig",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).NetworkLoadBalancerConfig, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.LoadBalancerConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CniConfigType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).CniConfigType = (string) content.GetValueForProperty("CniConfigType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).CniConfigType, global::System.Convert.ToString); + } + if (content.Contains("CniConfigVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).CniConfigVersion = (string) content.GetValueForProperty("CniConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).CniConfigVersion, global::System.Convert.ToString); + } + if (content.Contains("CniConfigPodSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).CniConfigPodSubnet = (string) content.GetValueForProperty("CniConfigPodSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).CniConfigPodSubnet, global::System.Convert.ToString); + } + if (content.Contains("CniConfigServiceSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).CniConfigServiceSubnet = (string) content.GetValueForProperty("CniConfigServiceSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).CniConfigServiceSubnet, global::System.Convert.ToString); + } + if (content.Contains("LoadBalancerConfigType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).LoadBalancerConfigType = (string) content.GetValueForProperty("LoadBalancerConfigType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).LoadBalancerConfigType, global::System.Convert.ToString); + } + if (content.Contains("LoadBalancerConfigVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).LoadBalancerConfigVersion = (string) content.GetValueForProperty("LoadBalancerConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).LoadBalancerConfigVersion, 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 KubernetesRoleProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KubernetesClusterInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KubernetesClusterInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfo) content.GetValueForProperty("KubernetesClusterInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KubernetesClusterInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesClusterInfoTypeConverter.ConvertFrom); + } + if (content.Contains("KubernetesRoleResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KubernetesRoleResource = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResources) content.GetValueForProperty("KubernetesRoleResource",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KubernetesRoleResource, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleResourcesTypeConverter.ConvertFrom); + } + if (content.Contains("HostPlatform")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).HostPlatform = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType) content.GetValueForProperty("HostPlatform",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).HostPlatform, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType.CreateFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState.CreateFrom); + } + if (content.Contains("HostPlatformType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).HostPlatformType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType?) content.GetValueForProperty("HostPlatformType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).HostPlatformType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType.CreateFrom); + } + if (content.Contains("RoleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).RoleStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) content.GetValueForProperty("RoleStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).RoleStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("KuberneteClusterInfoEtcdInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteClusterInfoEtcdInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfo) content.GetValueForProperty("KuberneteClusterInfoEtcdInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteClusterInfoEtcdInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.EtcdInfoTypeConverter.ConvertFrom); + } + if (content.Contains("KuberneteClusterInfoNode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteClusterInfoNode = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo[]) content.GetValueForProperty("KuberneteClusterInfoNode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteClusterInfoNode, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodeInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("KuberneteClusterInfoVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteClusterInfoVersion = (string) content.GetValueForProperty("KuberneteClusterInfoVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteClusterInfoVersion, global::System.Convert.ToString); + } + if (content.Contains("EtcdInfoType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).EtcdInfoType = (string) content.GetValueForProperty("EtcdInfoType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).EtcdInfoType, global::System.Convert.ToString); + } + if (content.Contains("EtcdInfoVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).EtcdInfoVersion = (string) content.GetValueForProperty("EtcdInfoVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).EtcdInfoVersion, global::System.Convert.ToString); + } + if (content.Contains("KuberneteRoleResourceStorage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteRoleResourceStorage = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage) content.GetValueForProperty("KuberneteRoleResourceStorage",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteRoleResourceStorage, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorageTypeConverter.ConvertFrom); + } + if (content.Contains("KuberneteRoleResourceCompute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteRoleResourceCompute = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute) content.GetValueForProperty("KuberneteRoleResourceCompute",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteRoleResourceCompute, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleComputeTypeConverter.ConvertFrom); + } + if (content.Contains("KuberneteRoleResourceNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteRoleResourceNetwork = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork) content.GetValueForProperty("KuberneteRoleResourceNetwork",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).KuberneteRoleResourceNetwork, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleNetworkTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkCniConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).NetworkCniConfig = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig) content.GetValueForProperty("NetworkCniConfig",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).NetworkCniConfig, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CniConfigTypeConverter.ConvertFrom); + } + if (content.Contains("StorageClass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).StorageClass = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[]) content.GetValueForProperty("StorageClass",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).StorageClass, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorageClassInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("StorageEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).StorageEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[]) content.GetValueForProperty("StorageEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).StorageEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMapTypeConverter.ConvertFrom)); + } + if (content.Contains("ComputeVMProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).ComputeVMProfile = (string) content.GetValueForProperty("ComputeVMProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).ComputeVMProfile, global::System.Convert.ToString); + } + if (content.Contains("ComputeMemoryInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).ComputeMemoryInByte = (long?) content.GetValueForProperty("ComputeMemoryInByte",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).ComputeMemoryInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ComputeProcessorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).ComputeProcessorCount = (int?) content.GetValueForProperty("ComputeProcessorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).ComputeProcessorCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetworkLoadBalancerConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).NetworkLoadBalancerConfig = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig) content.GetValueForProperty("NetworkLoadBalancerConfig",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).NetworkLoadBalancerConfig, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.LoadBalancerConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CniConfigType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).CniConfigType = (string) content.GetValueForProperty("CniConfigType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).CniConfigType, global::System.Convert.ToString); + } + if (content.Contains("CniConfigVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).CniConfigVersion = (string) content.GetValueForProperty("CniConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).CniConfigVersion, global::System.Convert.ToString); + } + if (content.Contains("CniConfigPodSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).CniConfigPodSubnet = (string) content.GetValueForProperty("CniConfigPodSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).CniConfigPodSubnet, global::System.Convert.ToString); + } + if (content.Contains("CniConfigServiceSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).CniConfigServiceSubnet = (string) content.GetValueForProperty("CniConfigServiceSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).CniConfigServiceSubnet, global::System.Convert.ToString); + } + if (content.Contains("LoadBalancerConfigType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).LoadBalancerConfigType = (string) content.GetValueForProperty("LoadBalancerConfigType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).LoadBalancerConfigType, global::System.Convert.ToString); + } + if (content.Contains("LoadBalancerConfigVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).LoadBalancerConfigVersion = (string) content.GetValueForProperty("LoadBalancerConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal)this).LoadBalancerConfigVersion, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Kubernetes role properties. + [System.ComponentModel.TypeConverter(typeof(KubernetesRolePropertiesTypeConverter))] + public partial interface IKubernetesRoleProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleProperties.TypeConverter.cs new file mode 100644 index 000000000000..7cef6a0fa8ad --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KubernetesRolePropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IKubernetesRoleProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KubernetesRoleProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KubernetesRoleProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KubernetesRoleProperties.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/databoxedge/generated/api/Models/Api20220301/KubernetesRoleProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleProperties.cs new file mode 100644 index 000000000000..5384e4f31343 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Kubernetes role properties. + public partial class KubernetesRoleProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal + { + + /// Pod Subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CniConfigPodSubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).CniConfigPodSubnet; } + + /// Service subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CniConfigServiceSubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).CniConfigServiceSubnet; } + + /// Cni type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CniConfigType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).CniConfigType; } + + /// Cni version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CniConfigVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).CniConfigVersion; } + + /// Memory in bytes + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public long? ComputeMemoryInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).ComputeMemoryInByte; } + + /// Processor count + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? ComputeProcessorCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).ComputeProcessorCount; } + + /// VM profile + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ComputeVMProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).ComputeVMProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).ComputeVMProfile = value ; } + + /// Etcd type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string EtcdInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)KubernetesClusterInfo).EtcdInfoType; } + + /// Etcd version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string EtcdInfoVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)KubernetesClusterInfo).EtcdInfoVersion; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType _hostPlatform; + + /// Host OS supported by the Kubernetes role. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType HostPlatform { get => this._hostPlatform; set => this._hostPlatform = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? _hostPlatformType; + + /// Platform where the runtime is hosted. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get => this._hostPlatformType; } + + /// Kubernetes cluster nodes + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo[] KuberneteClusterInfoNode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)KubernetesClusterInfo).Node; } + + /// Kubernetes cluster version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string KuberneteClusterInfoVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)KubernetesClusterInfo).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)KubernetesClusterInfo).Version = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfo _kubernetesClusterInfo; + + /// Kubernetes cluster configuration + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfo KubernetesClusterInfo { get => (this._kubernetesClusterInfo = this._kubernetesClusterInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesClusterInfo()); set => this._kubernetesClusterInfo = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResources _kubernetesRoleResource; + + /// Kubernetes role resources + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResources KubernetesRoleResource { get => (this._kubernetesRoleResource = this._kubernetesRoleResource ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleResources()); set => this._kubernetesRoleResource = value; } + + /// Load balancer type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string LoadBalancerConfigType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).LoadBalancerConfigType; } + + /// Load balancer version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string LoadBalancerConfigVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).LoadBalancerConfigVersion; } + + /// Internal Acessors for CniConfigPodSubnet + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.CniConfigPodSubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).CniConfigPodSubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).CniConfigPodSubnet = value; } + + /// Internal Acessors for CniConfigServiceSubnet + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.CniConfigServiceSubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).CniConfigServiceSubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).CniConfigServiceSubnet = value; } + + /// Internal Acessors for CniConfigType + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.CniConfigType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).CniConfigType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).CniConfigType = value; } + + /// Internal Acessors for CniConfigVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.CniConfigVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).CniConfigVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).CniConfigVersion = value; } + + /// Internal Acessors for ComputeMemoryInByte + long? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.ComputeMemoryInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).ComputeMemoryInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).ComputeMemoryInByte = value; } + + /// Internal Acessors for ComputeProcessorCount + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.ComputeProcessorCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).ComputeProcessorCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).ComputeProcessorCount = value; } + + /// Internal Acessors for EtcdInfoType + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.EtcdInfoType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)KubernetesClusterInfo).EtcdInfoType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)KubernetesClusterInfo).EtcdInfoType = value; } + + /// Internal Acessors for EtcdInfoVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.EtcdInfoVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)KubernetesClusterInfo).EtcdInfoVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)KubernetesClusterInfo).EtcdInfoVersion = value; } + + /// Internal Acessors for HostPlatformType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.HostPlatformType { get => this._hostPlatformType; set { {_hostPlatformType = value;} } } + + /// Internal Acessors for KuberneteClusterInfoEtcdInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.KuberneteClusterInfoEtcdInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)KubernetesClusterInfo).EtcdInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)KubernetesClusterInfo).EtcdInfo = value; } + + /// Internal Acessors for KuberneteClusterInfoNode + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.KuberneteClusterInfoNode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)KubernetesClusterInfo).Node; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfoInternal)KubernetesClusterInfo).Node = value; } + + /// Internal Acessors for KuberneteRoleResourceCompute + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.KuberneteRoleResourceCompute { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).Compute; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).Compute = value; } + + /// Internal Acessors for KuberneteRoleResourceNetwork + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.KuberneteRoleResourceNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).Network = value; } + + /// Internal Acessors for KuberneteRoleResourceStorage + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.KuberneteRoleResourceStorage { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).Storage; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).Storage = value; } + + /// Internal Acessors for KubernetesClusterInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.KubernetesClusterInfo { get => (this._kubernetesClusterInfo = this._kubernetesClusterInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesClusterInfo()); set { {_kubernetesClusterInfo = value;} } } + + /// Internal Acessors for KubernetesRoleResource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResources Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.KubernetesRoleResource { get => (this._kubernetesRoleResource = this._kubernetesRoleResource ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleResources()); set { {_kubernetesRoleResource = value;} } } + + /// Internal Acessors for LoadBalancerConfigType + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.LoadBalancerConfigType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).LoadBalancerConfigType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).LoadBalancerConfigType = value; } + + /// Internal Acessors for LoadBalancerConfigVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.LoadBalancerConfigVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).LoadBalancerConfigVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).LoadBalancerConfigVersion = value; } + + /// Internal Acessors for NetworkCniConfig + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.NetworkCniConfig { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).NetworkCniConfig; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).NetworkCniConfig = value; } + + /// Internal Acessors for NetworkLoadBalancerConfig + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.NetworkLoadBalancerConfig { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).NetworkLoadBalancerConfig; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).NetworkLoadBalancerConfig = value; } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for StorageClass + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRolePropertiesInternal.StorageClass { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).StorageClass; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).StorageClass = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState? _provisioningState; + + /// State of Kubernetes deployment + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState? ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus _roleStatus; + + /// Role status. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus RoleStatus { get => this._roleStatus; set => this._roleStatus = value; } + + /// Kubernetes storage class info. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[] StorageClass { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).StorageClass; } + + /// Mount points of shares in role(s). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] StorageEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).StorageEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)KubernetesRoleResource).StorageEndpoint = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public KubernetesRoleProperties() + { + + } + } + /// Kubernetes role properties. + public partial interface IKubernetesRoleProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Pod Subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Pod Subnet", + SerializedName = @"podSubnet", + PossibleTypes = new [] { typeof(string) })] + string CniConfigPodSubnet { get; } + /// Service subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Service subnet", + SerializedName = @"serviceSubnet", + PossibleTypes = new [] { typeof(string) })] + string CniConfigServiceSubnet { get; } + /// Cni type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Cni type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string CniConfigType { get; } + /// Cni version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Cni version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string CniConfigVersion { get; } + /// Memory in bytes + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Memory in bytes", + SerializedName = @"memoryInBytes", + PossibleTypes = new [] { typeof(long) })] + long? ComputeMemoryInByte { get; } + /// Processor count + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Processor count", + SerializedName = @"processorCount", + PossibleTypes = new [] { typeof(int) })] + int? ComputeProcessorCount { get; } + /// VM profile + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"VM profile", + SerializedName = @"vmProfile", + PossibleTypes = new [] { typeof(string) })] + string ComputeVMProfile { get; set; } + /// Etcd type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Etcd type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string EtcdInfoType { get; } + /// Etcd version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Etcd version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string EtcdInfoVersion { get; } + /// Host OS supported by the Kubernetes role. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Host OS supported by the Kubernetes role.", + SerializedName = @"hostPlatform", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType HostPlatform { get; set; } + /// Platform where the runtime is hosted. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Platform where the runtime is hosted.", + SerializedName = @"hostPlatformType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get; } + /// Kubernetes cluster nodes + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Kubernetes cluster nodes", + SerializedName = @"nodes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo[] KuberneteClusterInfoNode { get; } + /// Kubernetes cluster version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Kubernetes cluster version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string KuberneteClusterInfoVersion { get; set; } + /// Load balancer type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Load balancer type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string LoadBalancerConfigType { get; } + /// Load balancer version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Load balancer version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string LoadBalancerConfigVersion { get; } + /// State of Kubernetes deployment + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"State of Kubernetes deployment", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState? ProvisioningState { get; } + /// Role status. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Role status.", + SerializedName = @"roleStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus RoleStatus { get; set; } + /// Kubernetes storage class info. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Kubernetes storage class info.", + SerializedName = @"storageClasses", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[] StorageClass { get; } + /// Mount points of shares in role(s). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mount points of shares in role(s).", + SerializedName = @"endpoints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] StorageEndpoint { get; set; } + + } + /// Kubernetes role properties. + internal partial interface IKubernetesRolePropertiesInternal + + { + /// Pod Subnet + string CniConfigPodSubnet { get; set; } + /// Service subnet + string CniConfigServiceSubnet { get; set; } + /// Cni type + string CniConfigType { get; set; } + /// Cni version + string CniConfigVersion { get; set; } + /// Memory in bytes + long? ComputeMemoryInByte { get; set; } + /// Processor count + int? ComputeProcessorCount { get; set; } + /// VM profile + string ComputeVMProfile { get; set; } + /// Etcd type + string EtcdInfoType { get; set; } + /// Etcd version + string EtcdInfoVersion { get; set; } + /// Host OS supported by the Kubernetes role. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType HostPlatform { get; set; } + /// Platform where the runtime is hosted. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType? HostPlatformType { get; set; } + /// Etcd configuration + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IEtcdInfo KuberneteClusterInfoEtcdInfo { get; set; } + /// Kubernetes cluster nodes + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo[] KuberneteClusterInfoNode { get; set; } + /// Kubernetes cluster version + string KuberneteClusterInfoVersion { get; set; } + /// Kubernetes role compute resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute KuberneteRoleResourceCompute { get; set; } + /// Kubernetes role network resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork KuberneteRoleResourceNetwork { get; set; } + /// Kubernetes role storage resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage KuberneteRoleResourceStorage { get; set; } + /// Kubernetes cluster configuration + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesClusterInfo KubernetesClusterInfo { get; set; } + /// Kubernetes role resources + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResources KubernetesRoleResource { get; set; } + /// Load balancer type + string LoadBalancerConfigType { get; set; } + /// Load balancer version + string LoadBalancerConfigVersion { get; set; } + /// Cni configuration + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig NetworkCniConfig { get; set; } + /// Load balancer configuration + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig NetworkLoadBalancerConfig { get; set; } + /// State of Kubernetes deployment + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState? ProvisioningState { get; set; } + /// Role status. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus RoleStatus { get; set; } + /// Kubernetes storage class info. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[] StorageClass { get; set; } + /// Mount points of shares in role(s). + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] StorageEndpoint { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleProperties.json.cs new file mode 100644 index 000000000000..578f8a4fdef9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Kubernetes role properties. + public partial class KubernetesRoleProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new KubernetesRoleProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal KubernetesRoleProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_kubernetesClusterInfo = If( json?.PropertyT("kubernetesClusterInfo"), out var __jsonKubernetesClusterInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesClusterInfo.FromJson(__jsonKubernetesClusterInfo) : KubernetesClusterInfo;} + {_kubernetesRoleResource = If( json?.PropertyT("kubernetesRoleResources"), out var __jsonKubernetesRoleResources) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleResources.FromJson(__jsonKubernetesRoleResources) : KubernetesRoleResource;} + {_hostPlatform = If( json?.PropertyT("hostPlatform"), out var __jsonHostPlatform) ? (string)__jsonHostPlatform : (string)HostPlatform;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_hostPlatformType = If( json?.PropertyT("hostPlatformType"), out var __jsonHostPlatformType) ? (string)__jsonHostPlatformType : (string)HostPlatformType;} + {_roleStatus = If( json?.PropertyT("roleStatus"), out var __jsonRoleStatus) ? (string)__jsonRoleStatus : (string)RoleStatus;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._kubernetesClusterInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._kubernetesClusterInfo.ToJson(null,serializationMode) : null, "kubernetesClusterInfo" ,container.Add ); + AddIf( null != this._kubernetesRoleResource ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._kubernetesRoleResource.ToJson(null,serializationMode) : null, "kubernetesRoleResources" ,container.Add ); + AddIf( null != (((object)this._hostPlatform)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._hostPlatform.ToString()) : null, "hostPlatform" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._hostPlatformType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._hostPlatformType.ToString()) : null, "hostPlatformType" ,container.Add ); + } + AddIf( null != (((object)this._roleStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._roleStatus.ToString()) : null, "roleStatus" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleResources.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleResources.PowerShell.cs new file mode 100644 index 000000000000..c8f2c466a36e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleResources.PowerShell.cs @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Kubernetes role resources + [System.ComponentModel.TypeConverter(typeof(KubernetesRoleResourcesTypeConverter))] + public partial class KubernetesRoleResources + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IKubernetesRoleResources DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesRoleResources(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.DataBoxEdge.Models.Api20220301.IKubernetesRoleResources DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesRoleResources(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.DataBoxEdge.Models.Api20220301.IKubernetesRoleResources FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesRoleResources(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Storage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).Storage = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage) content.GetValueForProperty("Storage",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).Storage, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorageTypeConverter.ConvertFrom); + } + if (content.Contains("Compute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).Compute = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute) content.GetValueForProperty("Compute",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).Compute, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleComputeTypeConverter.ConvertFrom); + } + if (content.Contains("Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).Network = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork) content.GetValueForProperty("Network",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).Network, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleNetworkTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkCniConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).NetworkCniConfig = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig) content.GetValueForProperty("NetworkCniConfig",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).NetworkCniConfig, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CniConfigTypeConverter.ConvertFrom); + } + if (content.Contains("StorageClass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).StorageClass = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[]) content.GetValueForProperty("StorageClass",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).StorageClass, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorageClassInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("StorageEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).StorageEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[]) content.GetValueForProperty("StorageEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).StorageEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMapTypeConverter.ConvertFrom)); + } + if (content.Contains("ComputeVMProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).ComputeVMProfile = (string) content.GetValueForProperty("ComputeVMProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).ComputeVMProfile, global::System.Convert.ToString); + } + if (content.Contains("ComputeMemoryInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).ComputeMemoryInByte = (long?) content.GetValueForProperty("ComputeMemoryInByte",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).ComputeMemoryInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ComputeProcessorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).ComputeProcessorCount = (int?) content.GetValueForProperty("ComputeProcessorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).ComputeProcessorCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetworkLoadBalancerConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).NetworkLoadBalancerConfig = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig) content.GetValueForProperty("NetworkLoadBalancerConfig",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).NetworkLoadBalancerConfig, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.LoadBalancerConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CniConfigType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).CniConfigType = (string) content.GetValueForProperty("CniConfigType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).CniConfigType, global::System.Convert.ToString); + } + if (content.Contains("CniConfigVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).CniConfigVersion = (string) content.GetValueForProperty("CniConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).CniConfigVersion, global::System.Convert.ToString); + } + if (content.Contains("CniConfigPodSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).CniConfigPodSubnet = (string) content.GetValueForProperty("CniConfigPodSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).CniConfigPodSubnet, global::System.Convert.ToString); + } + if (content.Contains("CniConfigServiceSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).CniConfigServiceSubnet = (string) content.GetValueForProperty("CniConfigServiceSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).CniConfigServiceSubnet, global::System.Convert.ToString); + } + if (content.Contains("LoadBalancerConfigType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).LoadBalancerConfigType = (string) content.GetValueForProperty("LoadBalancerConfigType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).LoadBalancerConfigType, global::System.Convert.ToString); + } + if (content.Contains("LoadBalancerConfigVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).LoadBalancerConfigVersion = (string) content.GetValueForProperty("LoadBalancerConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).LoadBalancerConfigVersion, 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 KubernetesRoleResources(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Storage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).Storage = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage) content.GetValueForProperty("Storage",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).Storage, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorageTypeConverter.ConvertFrom); + } + if (content.Contains("Compute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).Compute = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute) content.GetValueForProperty("Compute",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).Compute, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleComputeTypeConverter.ConvertFrom); + } + if (content.Contains("Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).Network = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork) content.GetValueForProperty("Network",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).Network, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleNetworkTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkCniConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).NetworkCniConfig = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig) content.GetValueForProperty("NetworkCniConfig",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).NetworkCniConfig, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.CniConfigTypeConverter.ConvertFrom); + } + if (content.Contains("StorageClass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).StorageClass = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[]) content.GetValueForProperty("StorageClass",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).StorageClass, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorageClassInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("StorageEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).StorageEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[]) content.GetValueForProperty("StorageEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).StorageEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMapTypeConverter.ConvertFrom)); + } + if (content.Contains("ComputeVMProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).ComputeVMProfile = (string) content.GetValueForProperty("ComputeVMProfile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).ComputeVMProfile, global::System.Convert.ToString); + } + if (content.Contains("ComputeMemoryInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).ComputeMemoryInByte = (long?) content.GetValueForProperty("ComputeMemoryInByte",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).ComputeMemoryInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ComputeProcessorCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).ComputeProcessorCount = (int?) content.GetValueForProperty("ComputeProcessorCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).ComputeProcessorCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetworkLoadBalancerConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).NetworkLoadBalancerConfig = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig) content.GetValueForProperty("NetworkLoadBalancerConfig",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).NetworkLoadBalancerConfig, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.LoadBalancerConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CniConfigType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).CniConfigType = (string) content.GetValueForProperty("CniConfigType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).CniConfigType, global::System.Convert.ToString); + } + if (content.Contains("CniConfigVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).CniConfigVersion = (string) content.GetValueForProperty("CniConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).CniConfigVersion, global::System.Convert.ToString); + } + if (content.Contains("CniConfigPodSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).CniConfigPodSubnet = (string) content.GetValueForProperty("CniConfigPodSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).CniConfigPodSubnet, global::System.Convert.ToString); + } + if (content.Contains("CniConfigServiceSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).CniConfigServiceSubnet = (string) content.GetValueForProperty("CniConfigServiceSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).CniConfigServiceSubnet, global::System.Convert.ToString); + } + if (content.Contains("LoadBalancerConfigType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).LoadBalancerConfigType = (string) content.GetValueForProperty("LoadBalancerConfigType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).LoadBalancerConfigType, global::System.Convert.ToString); + } + if (content.Contains("LoadBalancerConfigVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).LoadBalancerConfigVersion = (string) content.GetValueForProperty("LoadBalancerConfigVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal)this).LoadBalancerConfigVersion, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Kubernetes role resources + [System.ComponentModel.TypeConverter(typeof(KubernetesRoleResourcesTypeConverter))] + public partial interface IKubernetesRoleResources + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleResources.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleResources.TypeConverter.cs new file mode 100644 index 000000000000..c240cb57c107 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleResources.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KubernetesRoleResourcesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IKubernetesRoleResources ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResources).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KubernetesRoleResources.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KubernetesRoleResources.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KubernetesRoleResources.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/databoxedge/generated/api/Models/Api20220301/KubernetesRoleResources.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleResources.cs new file mode 100644 index 000000000000..39d5c6c4f711 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleResources.cs @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Kubernetes role resources + public partial class KubernetesRoleResources : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResources, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal + { + + /// Pod Subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CniConfigPodSubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).CniConfigPodSubnet; } + + /// Service subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CniConfigServiceSubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).CniConfigServiceSubnet; } + + /// Cni type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CniConfigType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).CniConfigType; } + + /// Cni version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CniConfigVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).CniConfigVersion; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute _compute; + + /// Kubernetes role compute resource + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute Compute { get => (this._compute = this._compute ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleCompute()); set => this._compute = value; } + + /// Memory in bytes + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public long? ComputeMemoryInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)Compute).MemoryInByte; } + + /// Processor count + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? ComputeProcessorCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)Compute).ProcessorCount; } + + /// VM profile + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ComputeVMProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)Compute).VMProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)Compute).VMProfile = value ; } + + /// Load balancer type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string LoadBalancerConfigType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).LoadBalancerConfigType; } + + /// Load balancer version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string LoadBalancerConfigVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).LoadBalancerConfigVersion; } + + /// Internal Acessors for CniConfigPodSubnet + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal.CniConfigPodSubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).CniConfigPodSubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).CniConfigPodSubnet = value; } + + /// Internal Acessors for CniConfigServiceSubnet + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal.CniConfigServiceSubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).CniConfigServiceSubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).CniConfigServiceSubnet = value; } + + /// Internal Acessors for CniConfigType + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal.CniConfigType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).CniConfigType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).CniConfigType = value; } + + /// Internal Acessors for CniConfigVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal.CniConfigVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).CniConfigVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).CniConfigVersion = value; } + + /// Internal Acessors for Compute + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal.Compute { get => (this._compute = this._compute ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleCompute()); set { {_compute = value;} } } + + /// Internal Acessors for ComputeMemoryInByte + long? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal.ComputeMemoryInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)Compute).MemoryInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)Compute).MemoryInByte = value; } + + /// Internal Acessors for ComputeProcessorCount + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal.ComputeProcessorCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)Compute).ProcessorCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleComputeInternal)Compute).ProcessorCount = value; } + + /// Internal Acessors for LoadBalancerConfigType + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal.LoadBalancerConfigType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).LoadBalancerConfigType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).LoadBalancerConfigType = value; } + + /// Internal Acessors for LoadBalancerConfigVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal.LoadBalancerConfigVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).LoadBalancerConfigVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).LoadBalancerConfigVersion = value; } + + /// Internal Acessors for Network + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal.Network { get => (this._network = this._network ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleNetwork()); set { {_network = value;} } } + + /// Internal Acessors for NetworkCniConfig + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal.NetworkCniConfig { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).CniConfig; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).CniConfig = value; } + + /// Internal Acessors for NetworkLoadBalancerConfig + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal.NetworkLoadBalancerConfig { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).LoadBalancerConfig; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetworkInternal)Network).LoadBalancerConfig = value; } + + /// Internal Acessors for Storage + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal.Storage { get => (this._storage = this._storage ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorage()); set { {_storage = value;} } } + + /// Internal Acessors for StorageClass + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResourcesInternal.StorageClass { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageInternal)Storage).StorageClass; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageInternal)Storage).StorageClass = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork _network; + + /// Kubernetes role network resource + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork Network { get => (this._network = this._network ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleNetwork()); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage _storage; + + /// Kubernetes role storage resource + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage Storage { get => (this._storage = this._storage ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorage()); set => this._storage = value; } + + /// Kubernetes storage class info. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[] StorageClass { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageInternal)Storage).StorageClass; } + + /// Mount points of shares in role(s). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] StorageEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageInternal)Storage).Endpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageInternal)Storage).Endpoint = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public KubernetesRoleResources() + { + + } + } + /// Kubernetes role resources + public partial interface IKubernetesRoleResources : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Pod Subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Pod Subnet", + SerializedName = @"podSubnet", + PossibleTypes = new [] { typeof(string) })] + string CniConfigPodSubnet { get; } + /// Service subnet + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Service subnet", + SerializedName = @"serviceSubnet", + PossibleTypes = new [] { typeof(string) })] + string CniConfigServiceSubnet { get; } + /// Cni type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Cni type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string CniConfigType { get; } + /// Cni version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Cni version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string CniConfigVersion { get; } + /// Memory in bytes + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Memory in bytes", + SerializedName = @"memoryInBytes", + PossibleTypes = new [] { typeof(long) })] + long? ComputeMemoryInByte { get; } + /// Processor count + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Processor count", + SerializedName = @"processorCount", + PossibleTypes = new [] { typeof(int) })] + int? ComputeProcessorCount { get; } + /// VM profile + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"VM profile", + SerializedName = @"vmProfile", + PossibleTypes = new [] { typeof(string) })] + string ComputeVMProfile { get; set; } + /// Load balancer type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Load balancer type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string LoadBalancerConfigType { get; } + /// Load balancer version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Load balancer version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string LoadBalancerConfigVersion { get; } + /// Kubernetes storage class info. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Kubernetes storage class info.", + SerializedName = @"storageClasses", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[] StorageClass { get; } + /// Mount points of shares in role(s). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mount points of shares in role(s).", + SerializedName = @"endpoints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] StorageEndpoint { get; set; } + + } + /// Kubernetes role resources + internal partial interface IKubernetesRoleResourcesInternal + + { + /// Pod Subnet + string CniConfigPodSubnet { get; set; } + /// Service subnet + string CniConfigServiceSubnet { get; set; } + /// Cni type + string CniConfigType { get; set; } + /// Cni version + string CniConfigVersion { get; set; } + /// Kubernetes role compute resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleCompute Compute { get; set; } + /// Memory in bytes + long? ComputeMemoryInByte { get; set; } + /// Processor count + int? ComputeProcessorCount { get; set; } + /// VM profile + string ComputeVMProfile { get; set; } + /// Load balancer type + string LoadBalancerConfigType { get; set; } + /// Load balancer version + string LoadBalancerConfigVersion { get; set; } + /// Kubernetes role network resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleNetwork Network { get; set; } + /// Cni configuration + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ICniConfig NetworkCniConfig { get; set; } + /// Load balancer configuration + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig NetworkLoadBalancerConfig { get; set; } + /// Kubernetes role storage resource + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage Storage { get; set; } + /// Kubernetes storage class info. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[] StorageClass { get; set; } + /// Mount points of shares in role(s). + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] StorageEndpoint { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleResources.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleResources.json.cs new file mode 100644 index 000000000000..1f78b6e8a413 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleResources.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Kubernetes role resources + public partial class KubernetesRoleResources + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResources. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResources. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleResources FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new KubernetesRoleResources(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal KubernetesRoleResources(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_storage = If( json?.PropertyT("storage"), out var __jsonStorage) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorage.FromJson(__jsonStorage) : Storage;} + {_compute = If( json?.PropertyT("compute"), out var __jsonCompute) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleCompute.FromJson(__jsonCompute) : Compute;} + {_network = If( json?.PropertyT("network"), out var __jsonNetwork) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleNetwork.FromJson(__jsonNetwork) : Network;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._storage ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._storage.ToJson(null,serializationMode) : null, "storage" ,container.Add ); + AddIf( null != this._compute ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._compute.ToJson(null,serializationMode) : null, "compute" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._network ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._network.ToJson(null,serializationMode) : null, "network" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorage.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorage.PowerShell.cs new file mode 100644 index 000000000000..c7e2a0aba058 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorage.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Kubernetes role storage resource + [System.ComponentModel.TypeConverter(typeof(KubernetesRoleStorageTypeConverter))] + public partial class KubernetesRoleStorage + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesRoleStorage(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.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesRoleStorage(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.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesRoleStorage(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StorageClass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageInternal)this).StorageClass = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[]) content.GetValueForProperty("StorageClass",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageInternal)this).StorageClass, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorageClassInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[]) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageInternal)this).Endpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMapTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal KubernetesRoleStorage(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StorageClass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageInternal)this).StorageClass = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[]) content.GetValueForProperty("StorageClass",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageInternal)this).StorageClass, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorageClassInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[]) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageInternal)this).Endpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMapTypeConverter.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Kubernetes role storage resource + [System.ComponentModel.TypeConverter(typeof(KubernetesRoleStorageTypeConverter))] + public partial interface IKubernetesRoleStorage + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorage.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorage.TypeConverter.cs new file mode 100644 index 000000000000..7559485ff116 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorage.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KubernetesRoleStorageTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KubernetesRoleStorage.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KubernetesRoleStorage.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KubernetesRoleStorage.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/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorage.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorage.cs new file mode 100644 index 000000000000..df732ab412c3 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorage.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Kubernetes role storage resource + public partial class KubernetesRoleStorage : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] _endpoint; + + /// Mount points of shares in role(s). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] Endpoint { get => this._endpoint; set => this._endpoint = value; } + + /// Internal Acessors for StorageClass + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageInternal.StorageClass { get => this._storageClass; set { {_storageClass = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[] _storageClass; + + /// Kubernetes storage class info. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[] StorageClass { get => this._storageClass; } + + /// Creates an new instance. + public KubernetesRoleStorage() + { + + } + } + /// Kubernetes role storage resource + public partial interface IKubernetesRoleStorage : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Mount points of shares in role(s). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mount points of shares in role(s).", + SerializedName = @"endpoints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] Endpoint { get; set; } + /// Kubernetes storage class info. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Kubernetes storage class info.", + SerializedName = @"storageClasses", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[] StorageClass { get; } + + } + /// Kubernetes role storage resource + internal partial interface IKubernetesRoleStorageInternal + + { + /// Mount points of shares in role(s). + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] Endpoint { get; set; } + /// Kubernetes storage class info. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo[] StorageClass { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorage.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorage.json.cs new file mode 100644 index 000000000000..1b778c29faa2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorage.json.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Kubernetes role storage resource + public partial class KubernetesRoleStorage + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorage FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new KubernetesRoleStorage(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal KubernetesRoleStorage(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_storageClass = If( json?.PropertyT("storageClasses"), out var __jsonStorageClasses) ? If( __jsonStorageClasses as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesRoleStorageClassInfo.FromJson(__u) )) ))() : null : StorageClass;} + {_endpoint = If( json?.PropertyT("endpoints"), out var __jsonEndpoints) ? If( __jsonEndpoints as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IMountPointMap) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMap.FromJson(__p) )) ))() : null : Endpoint;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._storageClass) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._storageClass ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("storageClasses",__w); + } + } + if (null != this._endpoint) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __s in this._endpoint ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("endpoints",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorageClassInfo.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorageClassInfo.PowerShell.cs new file mode 100644 index 000000000000..20d9e05a97f8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorageClassInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Kubernetes storage class info. + [System.ComponentModel.TypeConverter(typeof(KubernetesRoleStorageClassInfoTypeConverter))] + public partial class KubernetesRoleStorageClassInfo + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesRoleStorageClassInfo(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.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesRoleStorageClassInfo(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.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesRoleStorageClassInfo(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.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PosixCompliant")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfoInternal)this).PosixCompliant = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PosixComplianceStatus?) content.GetValueForProperty("PosixCompliant",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfoInternal)this).PosixCompliant, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PosixComplianceStatus.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal KubernetesRoleStorageClassInfo(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.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PosixCompliant")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfoInternal)this).PosixCompliant = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PosixComplianceStatus?) content.GetValueForProperty("PosixCompliant",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfoInternal)this).PosixCompliant, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PosixComplianceStatus.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Kubernetes storage class info. + [System.ComponentModel.TypeConverter(typeof(KubernetesRoleStorageClassInfoTypeConverter))] + public partial interface IKubernetesRoleStorageClassInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorageClassInfo.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorageClassInfo.TypeConverter.cs new file mode 100644 index 000000000000..0cee5ff99b18 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorageClassInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KubernetesRoleStorageClassInfoTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KubernetesRoleStorageClassInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KubernetesRoleStorageClassInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KubernetesRoleStorageClassInfo.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/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorageClassInfo.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorageClassInfo.cs new file mode 100644 index 000000000000..15c6a1edf1c7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorageClassInfo.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Kubernetes storage class info. + public partial class KubernetesRoleStorageClassInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfoInternal + { + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfoInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for PosixCompliant + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PosixComplianceStatus? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfoInternal.PosixCompliant { get => this._posixCompliant; set { {_posixCompliant = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfoInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// Storage class name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PosixComplianceStatus? _posixCompliant; + + /// If provisioned storage is posix compliant. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PosixComplianceStatus? PosixCompliant { get => this._posixCompliant; } + + /// Backing field for property. + private string _type; + + /// Storage class type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public KubernetesRoleStorageClassInfo() + { + + } + } + /// Kubernetes storage class info. + public partial interface IKubernetesRoleStorageClassInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Storage class name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Storage class name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// If provisioned storage is posix compliant. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"If provisioned storage is posix compliant.", + SerializedName = @"posixCompliant", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PosixComplianceStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PosixComplianceStatus? PosixCompliant { get; } + /// Storage class type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Storage class type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// Kubernetes storage class info. + internal partial interface IKubernetesRoleStorageClassInfoInternal + + { + /// Storage class name. + string Name { get; set; } + /// If provisioned storage is posix compliant. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PosixComplianceStatus? PosixCompliant { get; set; } + /// Storage class type. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorageClassInfo.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorageClassInfo.json.cs new file mode 100644 index 000000000000..65c6331b55d3 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/KubernetesRoleStorageClassInfo.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Kubernetes storage class info. + public partial class KubernetesRoleStorageClassInfo + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesRoleStorageClassInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new KubernetesRoleStorageClassInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal KubernetesRoleStorageClassInfo(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_posixCompliant = If( json?.PropertyT("posixCompliant"), out var __jsonPosixCompliant) ? (string)__jsonPosixCompliant : (string)PosixCompliant;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._posixCompliant)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._posixCompliant.ToString()) : null, "posixCompliant" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/LoadBalancerConfig.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/LoadBalancerConfig.PowerShell.cs new file mode 100644 index 000000000000..f6c59823c4a4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/LoadBalancerConfig.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Load balancer configuration + [System.ComponentModel.TypeConverter(typeof(LoadBalancerConfigTypeConverter))] + public partial class LoadBalancerConfig + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LoadBalancerConfig(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.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LoadBalancerConfig(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.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LoadBalancerConfig(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.DataBoxEdge.Models.Api20220301.ILoadBalancerConfigInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfigInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfigInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfigInternal)this).Version, 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 LoadBalancerConfig(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.DataBoxEdge.Models.Api20220301.ILoadBalancerConfigInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfigInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfigInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfigInternal)this).Version, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Load balancer configuration + [System.ComponentModel.TypeConverter(typeof(LoadBalancerConfigTypeConverter))] + public partial interface ILoadBalancerConfig + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/LoadBalancerConfig.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/LoadBalancerConfig.TypeConverter.cs new file mode 100644 index 000000000000..d5487f6105df --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/LoadBalancerConfig.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LoadBalancerConfigTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LoadBalancerConfig.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LoadBalancerConfig.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LoadBalancerConfig.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/databoxedge/generated/api/Models/Api20220301/LoadBalancerConfig.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/LoadBalancerConfig.cs new file mode 100644 index 000000000000..c15c38e8e0e8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/LoadBalancerConfig.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Load balancer configuration + public partial class LoadBalancerConfig : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfigInternal + { + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfigInternal.Type { get => this._type; set { {_type = value;} } } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfigInternal.Version { get => this._version; set { {_version = value;} } } + + /// Backing field for property. + private string _type; + + /// Load balancer type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Backing field for property. + private string _version; + + /// Load balancer version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Version { get => this._version; } + + /// Creates an new instance. + public LoadBalancerConfig() + { + + } + } + /// Load balancer configuration + public partial interface ILoadBalancerConfig : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Load balancer type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Load balancer type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + /// Load balancer version + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Load balancer version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; } + + } + /// Load balancer configuration + internal partial interface ILoadBalancerConfigInternal + + { + /// Load balancer type + string Type { get; set; } + /// Load balancer version + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/LoadBalancerConfig.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/LoadBalancerConfig.json.cs new file mode 100644 index 000000000000..5d6340f36ed9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/LoadBalancerConfig.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Load balancer configuration + public partial class LoadBalancerConfig + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ILoadBalancerConfig FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new LoadBalancerConfig(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal LoadBalancerConfig(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRole.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRole.PowerShell.cs new file mode 100644 index 000000000000..0b26395205be --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRole.PowerShell.cs @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// MEC role. + [System.ComponentModel.TypeConverter(typeof(MecRoleTypeConverter))] + public partial class MecRole + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IMecRole DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MecRole(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.DataBoxEdge.Models.Api20220301.IMecRole DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MecRole(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.DataBoxEdge.Models.Api20220301.IMecRole FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MecRole(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.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MecRolePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes.CreateFrom); + } + if (content.Contains("RoleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).RoleStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) content.GetValueForProperty("RoleStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).RoleStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("ConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ControllerEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ControllerEndpoint = (string) content.GetValueForProperty("ControllerEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ControllerEndpoint, global::System.Convert.ToString); + } + if (content.Contains("ResourceUniqueId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ResourceUniqueId = (string) content.GetValueForProperty("ResourceUniqueId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ResourceUniqueId, global::System.Convert.ToString); + } + if (content.Contains("ConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("ConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("ConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ConnectionStringValue = (string) content.GetValueForProperty("ConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("ConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("ConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ConnectionStringEncryptionCertThumbprint, 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 MecRole(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.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MecRolePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes.CreateFrom); + } + if (content.Contains("RoleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).RoleStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) content.GetValueForProperty("RoleStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).RoleStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("ConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ControllerEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ControllerEndpoint = (string) content.GetValueForProperty("ControllerEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ControllerEndpoint, global::System.Convert.ToString); + } + if (content.Contains("ResourceUniqueId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ResourceUniqueId = (string) content.GetValueForProperty("ResourceUniqueId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ResourceUniqueId, global::System.Convert.ToString); + } + if (content.Contains("ConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("ConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("ConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ConnectionStringValue = (string) content.GetValueForProperty("ConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("ConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("ConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal)this).ConnectionStringEncryptionCertThumbprint, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// MEC role. + [System.ComponentModel.TypeConverter(typeof(MecRoleTypeConverter))] + public partial interface IMecRole + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRole.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRole.TypeConverter.cs new file mode 100644 index 000000000000..003eb68e8042 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRole.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MecRoleTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IMecRole ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRole).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MecRole.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MecRole.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MecRole.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/databoxedge/generated/api/Models/Api20220301/MecRole.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRole.cs new file mode 100644 index 000000000000..f694c99e7075 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRole.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// MEC role. + public partial class MecRole : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRole, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole __role = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Role(); + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? ConnectionStringEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)Property).ConnectionStringEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)Property).ConnectionStringEncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ConnectionStringEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)Property).ConnectionStringEncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)Property).ConnectionStringEncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ConnectionStringValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)Property).ConnectionStringValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)Property).ConnectionStringValue = value ?? null; } + + /// Controller Endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ControllerEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)Property).ControllerEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)Property).ControllerEndpoint = value ?? null; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Id; } + + /// Role type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).Kind = value ; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Type = value; } + + /// Internal Acessors for ConnectionString + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal.ConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)Property).ConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)Property).ConnectionString = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MecRoleProperties()); set { {_property = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemData = value; } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleProperties _property; + + /// Properties specific to MEC role. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MecRoleProperties()); set => this._property = value; } + + /// Unique Id of the Resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ResourceUniqueId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)Property).ResourceUniqueId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)Property).ResourceUniqueId = value ?? null; } + + /// Role status. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? RoleStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)Property).RoleStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)Property).RoleStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus)""); } + + /// Metadata pertaining to creation and last modification of Role + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)__role).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__role).Type; } + + /// Creates an new instance. + public MecRole() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__role), __role); + await eventListener.AssertObjectIsValid(nameof(__role), __role); + } + } + /// MEC role. + public partial interface IMecRole : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole + { + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? ConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string ConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string ConnectionStringValue { get; set; } + /// Controller Endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Controller Endpoint.", + SerializedName = @"controllerEndpoint", + PossibleTypes = new [] { typeof(string) })] + string ControllerEndpoint { get; set; } + /// Unique Id of the Resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unique Id of the Resource.", + SerializedName = @"resourceUniqueId", + PossibleTypes = new [] { typeof(string) })] + string ResourceUniqueId { get; set; } + /// Role status. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Role status.", + SerializedName = @"roleStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? RoleStatus { get; set; } + + } + /// MEC role. + internal partial interface IMecRoleInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal + { + /// Activation key of the MEC. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret ConnectionString { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? ConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string ConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string ConnectionStringValue { get; set; } + /// Controller Endpoint. + string ControllerEndpoint { get; set; } + /// Properties specific to MEC role. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleProperties Property { get; set; } + /// Unique Id of the Resource. + string ResourceUniqueId { get; set; } + /// Role status. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus? RoleStatus { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRole.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRole.json.cs new file mode 100644 index 000000000000..72d19de10230 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRole.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// MEC role. + public partial class MecRole + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRole. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRole. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRole FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new MecRole(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal MecRole(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __role = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Role(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MecRoleProperties.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __role?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/MecRoleProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRoleProperties.PowerShell.cs new file mode 100644 index 000000000000..643f69987406 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRoleProperties.PowerShell.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// MEC role properties. + [System.ComponentModel.TypeConverter(typeof(MecRolePropertiesTypeConverter))] + public partial class MecRoleProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IMecRoleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MecRoleProperties(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.DataBoxEdge.Models.Api20220301.IMecRoleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MecRoleProperties(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.DataBoxEdge.Models.Api20220301.IMecRoleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MecRoleProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ControllerEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ControllerEndpoint = (string) content.GetValueForProperty("ControllerEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ControllerEndpoint, global::System.Convert.ToString); + } + if (content.Contains("ResourceUniqueId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ResourceUniqueId = (string) content.GetValueForProperty("ResourceUniqueId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ResourceUniqueId, global::System.Convert.ToString); + } + if (content.Contains("RoleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).RoleStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) content.GetValueForProperty("RoleStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).RoleStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("ConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("ConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("ConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ConnectionStringValue = (string) content.GetValueForProperty("ConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("ConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("ConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ConnectionStringEncryptionCertThumbprint, 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 MecRoleProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ControllerEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ControllerEndpoint = (string) content.GetValueForProperty("ControllerEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ControllerEndpoint, global::System.Convert.ToString); + } + if (content.Contains("ResourceUniqueId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ResourceUniqueId = (string) content.GetValueForProperty("ResourceUniqueId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ResourceUniqueId, global::System.Convert.ToString); + } + if (content.Contains("RoleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).RoleStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) content.GetValueForProperty("RoleStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).RoleStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus.CreateFrom); + } + if (content.Contains("ConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("ConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("ConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ConnectionStringValue = (string) content.GetValueForProperty("ConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("ConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("ConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal)this).ConnectionStringEncryptionCertThumbprint, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// MEC role properties. + [System.ComponentModel.TypeConverter(typeof(MecRolePropertiesTypeConverter))] + public partial interface IMecRoleProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRoleProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRoleProperties.TypeConverter.cs new file mode 100644 index 000000000000..50e818a74ea0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRoleProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MecRolePropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IMecRoleProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MecRoleProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MecRoleProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MecRoleProperties.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/databoxedge/generated/api/Models/Api20220301/MecRoleProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRoleProperties.cs new file mode 100644 index 000000000000..fc13b75630ab --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRoleProperties.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// MEC role properties. + public partial class MecRoleProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret _connectionString; + + /// Activation key of the MEC. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret ConnectionString { get => (this._connectionString = this._connectionString ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret()); set => this._connectionString = value; } + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? ConnectionStringEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)ConnectionString).EncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)ConnectionString).EncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ConnectionStringEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)ConnectionString).EncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)ConnectionString).EncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ConnectionStringValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)ConnectionString).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)ConnectionString).Value = value ?? null; } + + /// Backing field for property. + private string _controllerEndpoint; + + /// Controller Endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ControllerEndpoint { get => this._controllerEndpoint; set => this._controllerEndpoint = value; } + + /// Internal Acessors for ConnectionString + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRolePropertiesInternal.ConnectionString { get => (this._connectionString = this._connectionString ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret()); set { {_connectionString = value;} } } + + /// Backing field for property. + private string _resourceUniqueId; + + /// Unique Id of the Resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ResourceUniqueId { get => this._resourceUniqueId; set => this._resourceUniqueId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus _roleStatus; + + /// Role status. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus RoleStatus { get => this._roleStatus; set => this._roleStatus = value; } + + /// Creates an new instance. + public MecRoleProperties() + { + + } + } + /// MEC role properties. + public partial interface IMecRoleProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? ConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string ConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string ConnectionStringValue { get; set; } + /// Controller Endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Controller Endpoint.", + SerializedName = @"controllerEndpoint", + PossibleTypes = new [] { typeof(string) })] + string ControllerEndpoint { get; set; } + /// Unique Id of the Resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unique Id of the Resource.", + SerializedName = @"resourceUniqueId", + PossibleTypes = new [] { typeof(string) })] + string ResourceUniqueId { get; set; } + /// Role status. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Role status.", + SerializedName = @"roleStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus RoleStatus { get; set; } + + } + /// MEC role properties. + internal partial interface IMecRolePropertiesInternal + + { + /// Activation key of the MEC. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret ConnectionString { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? ConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string ConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string ConnectionStringValue { get; set; } + /// Controller Endpoint. + string ControllerEndpoint { get; set; } + /// Unique Id of the Resource. + string ResourceUniqueId { get; set; } + /// Role status. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus RoleStatus { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRoleProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRoleProperties.json.cs new file mode 100644 index 000000000000..1a4ee310b3fe --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MecRoleProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// MEC role properties. + public partial class MecRoleProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMecRoleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new MecRoleProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal MecRoleProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_connectionString = If( json?.PropertyT("connectionString"), out var __jsonConnectionString) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret.FromJson(__jsonConnectionString) : ConnectionString;} + {_controllerEndpoint = If( json?.PropertyT("controllerEndpoint"), out var __jsonControllerEndpoint) ? (string)__jsonControllerEndpoint : (string)ControllerEndpoint;} + {_resourceUniqueId = If( json?.PropertyT("resourceUniqueId"), out var __jsonResourceUniqueId) ? (string)__jsonResourceUniqueId : (string)ResourceUniqueId;} + {_roleStatus = If( json?.PropertyT("roleStatus"), out var __jsonRoleStatus) ? (string)__jsonRoleStatus : (string)RoleStatus;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._connectionString ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._connectionString.ToJson(null,serializationMode) : null, "connectionString" ,container.Add ); + AddIf( null != (((object)this._controllerEndpoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._controllerEndpoint.ToString()) : null, "controllerEndpoint" ,container.Add ); + AddIf( null != (((object)this._resourceUniqueId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._resourceUniqueId.ToString()) : null, "resourceUniqueId" ,container.Add ); + AddIf( null != (((object)this._roleStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._roleStatus.ToString()) : null, "roleStatus" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricConfiguration.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricConfiguration.PowerShell.cs new file mode 100644 index 000000000000..7261aa1e0079 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricConfiguration.PowerShell.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Metric configuration. + [System.ComponentModel.TypeConverter(typeof(MetricConfigurationTypeConverter))] + public partial class MetricConfiguration + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IMetricConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MetricConfiguration(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.DataBoxEdge.Models.Api20220301.IMetricConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MetricConfiguration(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.DataBoxEdge.Models.Api20220301.IMetricConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MetricConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfigurationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfigurationInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("MdmAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfigurationInternal)this).MdmAccount = (string) content.GetValueForProperty("MdmAccount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfigurationInternal)this).MdmAccount, global::System.Convert.ToString); + } + if (content.Contains("MetricNameSpace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfigurationInternal)this).MetricNameSpace = (string) content.GetValueForProperty("MetricNameSpace",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfigurationInternal)this).MetricNameSpace, global::System.Convert.ToString); + } + if (content.Contains("CounterSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfigurationInternal)this).CounterSet = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterSet[]) content.GetValueForProperty("CounterSet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfigurationInternal)this).CounterSet, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricCounterSetTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MetricConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfigurationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfigurationInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("MdmAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfigurationInternal)this).MdmAccount = (string) content.GetValueForProperty("MdmAccount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfigurationInternal)this).MdmAccount, global::System.Convert.ToString); + } + if (content.Contains("MetricNameSpace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfigurationInternal)this).MetricNameSpace = (string) content.GetValueForProperty("MetricNameSpace",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfigurationInternal)this).MetricNameSpace, global::System.Convert.ToString); + } + if (content.Contains("CounterSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfigurationInternal)this).CounterSet = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterSet[]) content.GetValueForProperty("CounterSet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfigurationInternal)this).CounterSet, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricCounterSetTypeConverter.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Metric configuration. + [System.ComponentModel.TypeConverter(typeof(MetricConfigurationTypeConverter))] + public partial interface IMetricConfiguration + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricConfiguration.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricConfiguration.TypeConverter.cs new file mode 100644 index 000000000000..8b5c328ecfd0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricConfiguration.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MetricConfigurationTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IMetricConfiguration ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MetricConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MetricConfiguration.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MetricConfiguration.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/databoxedge/generated/api/Models/Api20220301/MetricConfiguration.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricConfiguration.cs new file mode 100644 index 000000000000..fae91321ab11 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricConfiguration.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Metric configuration. + public partial class MetricConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfigurationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterSet[] _counterSet; + + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterSet[] CounterSet { get => this._counterSet; set => this._counterSet = value; } + + /// Backing field for property. + private string _mdmAccount; + + /// The MDM account to which the counters should be pushed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string MdmAccount { get => this._mdmAccount; set => this._mdmAccount = value; } + + /// Backing field for property. + private string _metricNameSpace; + + /// + /// The MDM namespace to which the counters should be pushed. This is required if MDMAccount is specified + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string MetricNameSpace { get => this._metricNameSpace; set => this._metricNameSpace = value; } + + /// Backing field for property. + private string _resourceId; + + /// The Resource ID on which the metrics should be pushed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// Creates an new instance. + public MetricConfiguration() + { + + } + } + /// Metric configuration. + public partial interface IMetricConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Host name for the IoT hub associated to the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Host name for the IoT hub associated to the device.", + SerializedName = @"counterSets", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterSet) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterSet[] CounterSet { get; set; } + /// The MDM account to which the counters should be pushed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The MDM account to which the counters should be pushed.", + SerializedName = @"mdmAccount", + PossibleTypes = new [] { typeof(string) })] + string MdmAccount { get; set; } + /// + /// The MDM namespace to which the counters should be pushed. This is required if MDMAccount is specified + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The MDM namespace to which the counters should be pushed. This is required if MDMAccount is specified", + SerializedName = @"metricNameSpace", + PossibleTypes = new [] { typeof(string) })] + string MetricNameSpace { get; set; } + /// The Resource ID on which the metrics should be pushed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Resource ID on which the metrics should be pushed.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + /// Metric configuration. + internal partial interface IMetricConfigurationInternal + + { + /// Host name for the IoT hub associated to the device. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterSet[] CounterSet { get; set; } + /// The MDM account to which the counters should be pushed. + string MdmAccount { get; set; } + /// + /// The MDM namespace to which the counters should be pushed. This is required if MDMAccount is specified + /// + string MetricNameSpace { get; set; } + /// The Resource ID on which the metrics should be pushed. + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricConfiguration.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricConfiguration.json.cs new file mode 100644 index 000000000000..9be125033900 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricConfiguration.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Metric configuration. + public partial class MetricConfiguration + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new MetricConfiguration(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal MetricConfiguration(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_mdmAccount = If( json?.PropertyT("mdmAccount"), out var __jsonMdmAccount) ? (string)__jsonMdmAccount : (string)MdmAccount;} + {_metricNameSpace = If( json?.PropertyT("metricNameSpace"), out var __jsonMetricNameSpace) ? (string)__jsonMetricNameSpace : (string)MetricNameSpace;} + {_counterSet = If( json?.PropertyT("counterSets"), out var __jsonCounterSets) ? If( __jsonCounterSets as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IMetricCounterSet) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricCounterSet.FromJson(__u) )) ))() : null : CounterSet;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + AddIf( null != (((object)this._mdmAccount)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._mdmAccount.ToString()) : null, "mdmAccount" ,container.Add ); + AddIf( null != (((object)this._metricNameSpace)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._metricNameSpace.ToString()) : null, "metricNameSpace" ,container.Add ); + if (null != this._counterSet) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._counterSet ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("counterSets",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounter.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounter.PowerShell.cs new file mode 100644 index 000000000000..bec7f4647992 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounter.PowerShell.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The metric counter + [System.ComponentModel.TypeConverter(typeof(MetricCounterTypeConverter))] + public partial class MetricCounter + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IMetricCounter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MetricCounter(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.DataBoxEdge.Models.Api20220301.IMetricCounter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MetricCounter(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.DataBoxEdge.Models.Api20220301.IMetricCounter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MetricCounter(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.DataBoxEdge.Models.Api20220301.IMetricCounterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Instance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterInternal)this).Instance = (string) content.GetValueForProperty("Instance",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterInternal)this).Instance, global::System.Convert.ToString); + } + if (content.Contains("DimensionFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterInternal)this).DimensionFilter = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimension[]) content.GetValueForProperty("DimensionFilter",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterInternal)this).DimensionFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricDimensionTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterInternal)this).AdditionalDimension = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimension[]) content.GetValueForProperty("AdditionalDimension",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterInternal)this).AdditionalDimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricDimensionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MetricCounter(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.DataBoxEdge.Models.Api20220301.IMetricCounterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Instance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterInternal)this).Instance = (string) content.GetValueForProperty("Instance",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterInternal)this).Instance, global::System.Convert.ToString); + } + if (content.Contains("DimensionFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterInternal)this).DimensionFilter = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimension[]) content.GetValueForProperty("DimensionFilter",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterInternal)this).DimensionFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricDimensionTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterInternal)this).AdditionalDimension = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimension[]) content.GetValueForProperty("AdditionalDimension",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterInternal)this).AdditionalDimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricDimensionTypeConverter.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The metric counter + [System.ComponentModel.TypeConverter(typeof(MetricCounterTypeConverter))] + public partial interface IMetricCounter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounter.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounter.TypeConverter.cs new file mode 100644 index 000000000000..6d9f335e5bbb --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounter.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MetricCounterTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IMetricCounter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MetricCounter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MetricCounter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MetricCounter.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/databoxedge/generated/api/Models/Api20220301/MetricCounter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounter.cs new file mode 100644 index 000000000000..60bebfc54904 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounter.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The metric counter + public partial class MetricCounter : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounter, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimension[] _additionalDimension; + + /// The additional dimensions to be added to metric. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimension[] AdditionalDimension { get => this._additionalDimension; set => this._additionalDimension = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimension[] _dimensionFilter; + + /// The dimension filter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimension[] DimensionFilter { get => this._dimensionFilter; set => this._dimensionFilter = value; } + + /// Backing field for property. + private string _instance; + + /// The instance from which counter should be collected. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Instance { get => this._instance; set => this._instance = value; } + + /// Backing field for property. + private string _name; + + /// The counter name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public MetricCounter() + { + + } + } + /// The metric counter + public partial interface IMetricCounter : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The additional dimensions to be added to metric. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The additional dimensions to be added to metric.", + SerializedName = @"additionalDimensions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimension) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimension[] AdditionalDimension { get; set; } + /// The dimension filter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The dimension filter.", + SerializedName = @"dimensionFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimension) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimension[] DimensionFilter { get; set; } + /// The instance from which counter should be collected. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The instance from which counter should be collected.", + SerializedName = @"instance", + PossibleTypes = new [] { typeof(string) })] + string Instance { get; set; } + /// The counter name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The counter name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// The metric counter + internal partial interface IMetricCounterInternal + + { + /// The additional dimensions to be added to metric. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimension[] AdditionalDimension { get; set; } + /// The dimension filter. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimension[] DimensionFilter { get; set; } + /// The instance from which counter should be collected. + string Instance { get; set; } + /// The counter name. + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounter.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounter.json.cs new file mode 100644 index 000000000000..c6b14a955ef5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounter.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The metric counter + public partial class MetricCounter + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounter FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new MetricCounter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal MetricCounter(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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;} + {_instance = If( json?.PropertyT("instance"), out var __jsonInstance) ? (string)__jsonInstance : (string)Instance;} + {_dimensionFilter = If( json?.PropertyT("dimensionFilter"), out var __jsonDimensionFilter) ? If( __jsonDimensionFilter as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IMetricDimension) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricDimension.FromJson(__u) )) ))() : null : DimensionFilter;} + {_additionalDimension = If( json?.PropertyT("additionalDimensions"), out var __jsonAdditionalDimensions) ? If( __jsonAdditionalDimensions as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IMetricDimension) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricDimension.FromJson(__p) )) ))() : null : AdditionalDimension;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._instance)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._instance.ToString()) : null, "instance" ,container.Add ); + if (null != this._dimensionFilter) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._dimensionFilter ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("dimensionFilter",__w); + } + if (null != this._additionalDimension) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __s in this._additionalDimension ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("additionalDimensions",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounterSet.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounterSet.PowerShell.cs new file mode 100644 index 000000000000..8b4f3705287b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounterSet.PowerShell.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The metric counter set + [System.ComponentModel.TypeConverter(typeof(MetricCounterSetTypeConverter))] + public partial class MetricCounterSet + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IMetricCounterSet DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MetricCounterSet(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.DataBoxEdge.Models.Api20220301.IMetricCounterSet DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MetricCounterSet(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.DataBoxEdge.Models.Api20220301.IMetricCounterSet FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MetricCounterSet(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Counter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterSetInternal)this).Counter = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounter[]) content.GetValueForProperty("Counter",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterSetInternal)this).Counter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricCounterTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MetricCounterSet(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Counter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterSetInternal)this).Counter = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounter[]) content.GetValueForProperty("Counter",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterSetInternal)this).Counter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricCounterTypeConverter.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The metric counter set + [System.ComponentModel.TypeConverter(typeof(MetricCounterSetTypeConverter))] + public partial interface IMetricCounterSet + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounterSet.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounterSet.TypeConverter.cs new file mode 100644 index 000000000000..d339fc0126e3 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounterSet.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MetricCounterSetTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IMetricCounterSet ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterSet).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MetricCounterSet.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MetricCounterSet.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MetricCounterSet.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/databoxedge/generated/api/Models/Api20220301/MetricCounterSet.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounterSet.cs new file mode 100644 index 000000000000..0e6bed5657cb --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounterSet.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The metric counter set + public partial class MetricCounterSet : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterSet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterSetInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounter[] _counter; + + /// The counters that should be collected in this set. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounter[] Counter { get => this._counter; set => this._counter = value; } + + /// Creates an new instance. + public MetricCounterSet() + { + + } + } + /// The metric counter set + public partial interface IMetricCounterSet : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The counters that should be collected in this set. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The counters that should be collected in this set.", + SerializedName = @"counters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounter) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounter[] Counter { get; set; } + + } + /// The metric counter set + internal partial interface IMetricCounterSetInternal + + { + /// The counters that should be collected in this set. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounter[] Counter { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounterSet.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounterSet.json.cs new file mode 100644 index 000000000000..d63aaa117dfa --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricCounterSet.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The metric counter set + public partial class MetricCounterSet + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterSet. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterSet. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricCounterSet FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new MetricCounterSet(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal MetricCounterSet(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_counter = If( json?.PropertyT("counters"), out var __jsonCounters) ? If( __jsonCounters as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IMetricCounter) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricCounter.FromJson(__u) )) ))() : null : Counter;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._counter) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._counter ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("counters",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimension.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimension.PowerShell.cs new file mode 100644 index 000000000000..55e94067274c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimension.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The 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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IMetricDimension FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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("SourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionInternal)this).SourceType = (string) content.GetValueForProperty("SourceType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionInternal)this).SourceType, global::System.Convert.ToString); + } + if (content.Contains("SourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionInternal)this).SourceName = (string) content.GetValueForProperty("SourceName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionInternal)this).SourceName, 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("SourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionInternal)this).SourceType = (string) content.GetValueForProperty("SourceType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionInternal)this).SourceType, global::System.Convert.ToString); + } + if (content.Contains("SourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionInternal)this).SourceName = (string) content.GetValueForProperty("SourceName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionInternal)this).SourceName, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The metric dimension + [System.ComponentModel.TypeConverter(typeof(MetricDimensionTypeConverter))] + public partial interface IMetricDimension + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimension.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimension.TypeConverter.cs new file mode 100644 index 000000000000..79a22c485f55 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IMetricDimension ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/MetricDimension.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimension.cs new file mode 100644 index 000000000000..6e6017aa2664 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The metric dimension + public partial class MetricDimension : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimension, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionInternal + { + + /// Backing field for property. + private string _sourceName; + + /// The dimension value. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string SourceName { get => this._sourceName; set => this._sourceName = value; } + + /// Backing field for property. + private string _sourceType; + + /// The dimension type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string SourceType { get => this._sourceType; set => this._sourceType = value; } + + /// Creates an new instance. + public MetricDimension() + { + + } + } + /// The metric dimension + public partial interface IMetricDimension : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The dimension value. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The dimension value.", + SerializedName = @"sourceName", + PossibleTypes = new [] { typeof(string) })] + string SourceName { get; set; } + /// The dimension type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The dimension type.", + SerializedName = @"sourceType", + PossibleTypes = new [] { typeof(string) })] + string SourceType { get; set; } + + } + /// The metric dimension + internal partial interface IMetricDimensionInternal + + { + /// The dimension value. + string SourceName { get; set; } + /// The dimension type. + string SourceType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimension.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimension.json.cs new file mode 100644 index 000000000000..9bf15b9f1575 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimension.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimension. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimension. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimension FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new MetricDimension(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal MetricDimension(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceType = If( json?.PropertyT("sourceType"), out var __jsonSourceType) ? (string)__jsonSourceType : (string)SourceType;} + {_sourceName = If( json?.PropertyT("sourceName"), out var __jsonSourceName) ? (string)__jsonSourceName : (string)SourceName;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._sourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._sourceType.ToString()) : null, "sourceType" ,container.Add ); + AddIf( null != (((object)this._sourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._sourceName.ToString()) : null, "sourceName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimensionV1.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimensionV1.PowerShell.cs new file mode 100644 index 000000000000..d036ee765547 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimensionV1.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Metric Dimension v1. + [System.ComponentModel.TypeConverter(typeof(MetricDimensionV1TypeConverter))] + public partial class MetricDimensionV1 + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IMetricDimensionV1 DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MetricDimensionV1(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.DataBoxEdge.Models.Api20220301.IMetricDimensionV1 DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MetricDimensionV1(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.DataBoxEdge.Models.Api20220301.IMetricDimensionV1 FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MetricDimensionV1(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.DataBoxEdge.Models.Api20220301.IMetricDimensionV1Internal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1Internal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1Internal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1Internal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("ToBeExportedForShoebox")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1Internal)this).ToBeExportedForShoebox = (bool?) content.GetValueForProperty("ToBeExportedForShoebox",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1Internal)this).ToBeExportedForShoebox, (__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 MetricDimensionV1(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.DataBoxEdge.Models.Api20220301.IMetricDimensionV1Internal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1Internal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1Internal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1Internal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("ToBeExportedForShoebox")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1Internal)this).ToBeExportedForShoebox = (bool?) content.GetValueForProperty("ToBeExportedForShoebox",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1Internal)this).ToBeExportedForShoebox, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Metric Dimension v1. + [System.ComponentModel.TypeConverter(typeof(MetricDimensionV1TypeConverter))] + public partial interface IMetricDimensionV1 + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimensionV1.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimensionV1.TypeConverter.cs new file mode 100644 index 000000000000..ba9013203d15 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimensionV1.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MetricDimensionV1TypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IMetricDimensionV1 ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MetricDimensionV1.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MetricDimensionV1.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MetricDimensionV1.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/databoxedge/generated/api/Models/Api20220301/MetricDimensionV1.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimensionV1.cs new file mode 100644 index 000000000000..bfe430d6e011 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimensionV1.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Metric Dimension v1. + public partial class MetricDimensionV1 : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1Internal + { + + /// Backing field for property. + private string _displayName; + + /// Display name of the metrics dimension. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private string _name; + + /// Name of the metrics dimension. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private bool? _toBeExportedForShoebox; + + /// To be exported to shoe box. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public bool? ToBeExportedForShoebox { get => this._toBeExportedForShoebox; set => this._toBeExportedForShoebox = value; } + + /// Creates an new instance. + public MetricDimensionV1() + { + + } + } + /// Metric Dimension v1. + public partial interface IMetricDimensionV1 : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Display name of the metrics dimension. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the metrics dimension.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// Name of the metrics dimension. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the metrics dimension.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// To be exported to shoe box. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To be exported to shoe box.", + SerializedName = @"toBeExportedForShoebox", + PossibleTypes = new [] { typeof(bool) })] + bool? ToBeExportedForShoebox { get; set; } + + } + /// Metric Dimension v1. + internal partial interface IMetricDimensionV1Internal + + { + /// Display name of the metrics dimension. + string DisplayName { get; set; } + /// Name of the metrics dimension. + string Name { get; set; } + /// To be exported to shoe box. + bool? ToBeExportedForShoebox { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimensionV1.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimensionV1.json.cs new file mode 100644 index 000000000000..3d5821e889d9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricDimensionV1.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Metric Dimension v1. + public partial class MetricDimensionV1 + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1 FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new MetricDimensionV1(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal MetricDimensionV1(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_toBeExportedForShoebox = If( json?.PropertyT("toBeExportedForShoebox"), out var __jsonToBeExportedForShoebox) ? (bool?)__jsonToBeExportedForShoebox : ToBeExportedForShoebox;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != this._toBeExportedForShoebox ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonBoolean((bool)this._toBeExportedForShoebox) : null, "toBeExportedForShoebox" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricSpecificationV1.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricSpecificationV1.PowerShell.cs new file mode 100644 index 000000000000..7536b279b0ad --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricSpecificationV1.PowerShell.cs @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Metric specification version 1. + [System.ComponentModel.TypeConverter(typeof(MetricSpecificationV1TypeConverter))] + public partial class MetricSpecificationV1 + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1 DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MetricSpecificationV1(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.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1 DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MetricSpecificationV1(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.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1 FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MetricSpecificationV1(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.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).DisplayDescription, global::System.Convert.ToString); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).Unit = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricUnit?) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).Unit, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricUnit.CreateFrom); + } + if (content.Contains("AggregationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).AggregationType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType?) content.GetValueForProperty("AggregationType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).AggregationType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType.CreateFrom); + } + if (content.Contains("Dimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1[]) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).Dimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricDimensionV1TypeConverter.ConvertFrom)); + } + if (content.Contains("FillGapWithZero")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).FillGapWithZero = (bool?) content.GetValueForProperty("FillGapWithZero",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).FillGapWithZero, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).Category = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricCategory?) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).Category, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricCategory.CreateFrom); + } + if (content.Contains("ResourceIdDimensionNameOverride")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).ResourceIdDimensionNameOverride = (string) content.GetValueForProperty("ResourceIdDimensionNameOverride",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).ResourceIdDimensionNameOverride, global::System.Convert.ToString); + } + if (content.Contains("SupportedTimeGrainType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).SupportedTimeGrainType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain[]) content.GetValueForProperty("SupportedTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).SupportedTimeGrainType, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain.CreateFrom)); + } + if (content.Contains("SupportedAggregationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).SupportedAggregationType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType[]) content.GetValueForProperty("SupportedAggregationType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).SupportedAggregationType, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType.CreateFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MetricSpecificationV1(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.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).DisplayDescription, global::System.Convert.ToString); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).Unit = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricUnit?) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).Unit, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricUnit.CreateFrom); + } + if (content.Contains("AggregationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).AggregationType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType?) content.GetValueForProperty("AggregationType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).AggregationType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType.CreateFrom); + } + if (content.Contains("Dimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1[]) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).Dimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricDimensionV1TypeConverter.ConvertFrom)); + } + if (content.Contains("FillGapWithZero")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).FillGapWithZero = (bool?) content.GetValueForProperty("FillGapWithZero",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).FillGapWithZero, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).Category = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricCategory?) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).Category, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricCategory.CreateFrom); + } + if (content.Contains("ResourceIdDimensionNameOverride")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).ResourceIdDimensionNameOverride = (string) content.GetValueForProperty("ResourceIdDimensionNameOverride",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).ResourceIdDimensionNameOverride, global::System.Convert.ToString); + } + if (content.Contains("SupportedTimeGrainType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).SupportedTimeGrainType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain[]) content.GetValueForProperty("SupportedTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).SupportedTimeGrainType, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain.CreateFrom)); + } + if (content.Contains("SupportedAggregationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).SupportedAggregationType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType[]) content.GetValueForProperty("SupportedAggregationType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal)this).SupportedAggregationType, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Metric specification version 1. + [System.ComponentModel.TypeConverter(typeof(MetricSpecificationV1TypeConverter))] + public partial interface IMetricSpecificationV1 + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricSpecificationV1.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricSpecificationV1.TypeConverter.cs new file mode 100644 index 000000000000..10d45c67bc94 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricSpecificationV1.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MetricSpecificationV1TypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1 ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MetricSpecificationV1.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MetricSpecificationV1.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MetricSpecificationV1.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/databoxedge/generated/api/Models/Api20220301/MetricSpecificationV1.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricSpecificationV1.cs new file mode 100644 index 000000000000..0daa957fa841 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricSpecificationV1.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Metric specification version 1. + public partial class MetricSpecificationV1 : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1Internal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType? _aggregationType; + + /// Metric aggregation type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType? AggregationType { get => this._aggregationType; set => this._aggregationType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricCategory? _category; + + /// Metric category. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricCategory? Category { get => this._category; set => this._category = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1[] _dimension; + + /// Metric dimensions, other than default dimension which is resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1[] Dimension { get => this._dimension; set => this._dimension = value; } + + /// Backing field for property. + private string _displayDescription; + + /// Description of the metric to be displayed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string DisplayDescription { get => this._displayDescription; set => this._displayDescription = value; } + + /// Backing field for property. + private string _displayName; + + /// Display name of the metric. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private bool? _fillGapWithZero; + + /// Set true to fill the gaps with zero. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public bool? FillGapWithZero { get => this._fillGapWithZero; set => this._fillGapWithZero = value; } + + /// Backing field for property. + private string _name; + + /// Name of the metric. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _resourceIdDimensionNameOverride; + + /// Resource name override. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ResourceIdDimensionNameOverride { get => this._resourceIdDimensionNameOverride; set => this._resourceIdDimensionNameOverride = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType[] _supportedAggregationType; + + /// Support metric aggregation type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType[] SupportedAggregationType { get => this._supportedAggregationType; set => this._supportedAggregationType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain[] _supportedTimeGrainType; + + /// Support granularity of metrics. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain[] SupportedTimeGrainType { get => this._supportedTimeGrainType; set => this._supportedTimeGrainType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricUnit? _unit; + + /// Metric units. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricUnit? Unit { get => this._unit; set => this._unit = value; } + + /// Creates an new instance. + public MetricSpecificationV1() + { + + } + } + /// Metric specification version 1. + public partial interface IMetricSpecificationV1 : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Metric aggregation type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Metric aggregation type.", + SerializedName = @"aggregationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType? AggregationType { get; set; } + /// Metric category. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Metric category.", + SerializedName = @"category", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricCategory) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricCategory? Category { get; set; } + /// Metric dimensions, other than default dimension which is resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Metric dimensions, other than default dimension which is resource.", + SerializedName = @"dimensions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1[] Dimension { get; set; } + /// Description of the metric to be displayed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the metric to be displayed.", + SerializedName = @"displayDescription", + PossibleTypes = new [] { typeof(string) })] + string DisplayDescription { get; set; } + /// Display name of the metric. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the metric.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// Set true to fill the gaps with zero. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set true to fill the gaps with zero.", + SerializedName = @"fillGapWithZero", + PossibleTypes = new [] { typeof(bool) })] + bool? FillGapWithZero { get; set; } + /// Name of the metric. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the metric.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Resource name override. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource name override.", + SerializedName = @"resourceIdDimensionNameOverride", + PossibleTypes = new [] { typeof(string) })] + string ResourceIdDimensionNameOverride { get; set; } + /// Support metric aggregation type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Support metric aggregation type.", + SerializedName = @"supportedAggregationTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType[] SupportedAggregationType { get; set; } + /// Support granularity of metrics. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Support granularity of metrics.", + SerializedName = @"supportedTimeGrainTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain[] SupportedTimeGrainType { get; set; } + /// Metric units. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Metric units.", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricUnit) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricUnit? Unit { get; set; } + + } + /// Metric specification version 1. + internal partial interface IMetricSpecificationV1Internal + + { + /// Metric aggregation type. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType? AggregationType { get; set; } + /// Metric category. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricCategory? Category { get; set; } + /// Metric dimensions, other than default dimension which is resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricDimensionV1[] Dimension { get; set; } + /// Description of the metric to be displayed. + string DisplayDescription { get; set; } + /// Display name of the metric. + string DisplayName { get; set; } + /// Set true to fill the gaps with zero. + bool? FillGapWithZero { get; set; } + /// Name of the metric. + string Name { get; set; } + /// Resource name override. + string ResourceIdDimensionNameOverride { get; set; } + /// Support metric aggregation type. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType[] SupportedAggregationType { get; set; } + /// Support granularity of metrics. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain[] SupportedTimeGrainType { get; set; } + /// Metric units. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricUnit? Unit { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricSpecificationV1.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricSpecificationV1.json.cs new file mode 100644 index 000000000000..2bfef82f6b60 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MetricSpecificationV1.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Metric specification version 1. + public partial class MetricSpecificationV1 + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1 FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new MetricSpecificationV1(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal MetricSpecificationV1(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_displayDescription = If( json?.PropertyT("displayDescription"), out var __jsonDisplayDescription) ? (string)__jsonDisplayDescription : (string)DisplayDescription;} + {_unit = If( json?.PropertyT("unit"), out var __jsonUnit) ? (string)__jsonUnit : (string)Unit;} + {_aggregationType = If( json?.PropertyT("aggregationType"), out var __jsonAggregationType) ? (string)__jsonAggregationType : (string)AggregationType;} + {_dimension = If( json?.PropertyT("dimensions"), out var __jsonDimensions) ? If( __jsonDimensions as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IMetricDimensionV1) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricDimensionV1.FromJson(__u) )) ))() : null : Dimension;} + {_fillGapWithZero = If( json?.PropertyT("fillGapWithZero"), out var __jsonFillGapWithZero) ? (bool?)__jsonFillGapWithZero : FillGapWithZero;} + {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)Category;} + {_resourceIdDimensionNameOverride = If( json?.PropertyT("resourceIdDimensionNameOverride"), out var __jsonResourceIdDimensionNameOverride) ? (string)__jsonResourceIdDimensionNameOverride : (string)ResourceIdDimensionNameOverride;} + {_supportedTimeGrainType = If( json?.PropertyT("supportedTimeGrainTypes"), out var __jsonSupportedTimeGrainTypes) ? If( __jsonSupportedTimeGrainTypes as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Support.TimeGrain) (__p is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString __o ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain)(__o.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain)""))) ))() : null : SupportedTimeGrainType;} + {_supportedAggregationType = If( json?.PropertyT("supportedAggregationTypes"), out var __jsonSupportedAggregationTypes) ? If( __jsonSupportedAggregationTypes as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType) (__k is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString __j ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType)(__j.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType)""))) ))() : null : SupportedAggregationType;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._displayDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._displayDescription.ToString()) : null, "displayDescription" ,container.Add ); + AddIf( null != (((object)this._unit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._unit.ToString()) : null, "unit" ,container.Add ); + AddIf( null != (((object)this._aggregationType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._aggregationType.ToString()) : null, "aggregationType" ,container.Add ); + if (null != this._dimension) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._dimension ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("dimensions",__w); + } + AddIf( null != this._fillGapWithZero ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonBoolean((bool)this._fillGapWithZero) : null, "fillGapWithZero" ,container.Add ); + AddIf( null != (((object)this._category)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._category.ToString()) : null, "category" ,container.Add ); + AddIf( null != (((object)this._resourceIdDimensionNameOverride)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._resourceIdDimensionNameOverride.ToString()) : null, "resourceIdDimensionNameOverride" ,container.Add ); + if (null != this._supportedTimeGrainType) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __s in this._supportedTimeGrainType ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("supportedTimeGrainTypes",__r); + } + if (null != this._supportedAggregationType) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __n in this._supportedAggregationType ) + { + AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); + } + container.Add("supportedAggregationTypes",__m); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfiguration.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfiguration.PowerShell.cs new file mode 100644 index 000000000000..8628f0be14f2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfiguration.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The metric setting details for the role + [System.ComponentModel.TypeConverter(typeof(MonitoringMetricConfigurationTypeConverter))] + public partial class MonitoringMetricConfiguration + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MonitoringMetricConfiguration(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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MonitoringMetricConfiguration(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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MonitoringMetricConfiguration(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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MonitoringMetricConfigurationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MetricConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).MetricConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration[]) content.GetValueForProperty("MetricConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).MetricConfiguration, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataLastModifiedAt, (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 MonitoringMetricConfiguration(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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MonitoringMetricConfigurationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MetricConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).MetricConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration[]) content.GetValueForProperty("MetricConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).MetricConfiguration, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal)this).SystemDataLastModifiedAt, (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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The metric setting details for the role + [System.ComponentModel.TypeConverter(typeof(MonitoringMetricConfigurationTypeConverter))] + public partial interface IMonitoringMetricConfiguration + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfiguration.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfiguration.TypeConverter.cs new file mode 100644 index 000000000000..379a2cea7261 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfiguration.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MonitoringMetricConfigurationTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MonitoringMetricConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MonitoringMetricConfiguration.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MonitoringMetricConfiguration.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/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfiguration.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfiguration.cs new file mode 100644 index 000000000000..170c5faef189 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfiguration.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The metric setting details for the role + public partial class MonitoringMetricConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// The metrics configuration details + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration[] MetricConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationPropertiesInternal)Property).MetricConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationPropertiesInternal)Property).MetricConfiguration = value ; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MonitoringMetricConfigurationProperties()); set { {_property = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationProperties _property; + + /// The metric setting properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MonitoringMetricConfigurationProperties()); set => this._property = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// + /// Metadata pertaining to creation and last modification of MonitoringConfiguration + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Creates an new instance. + public MonitoringMetricConfiguration() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// The metric setting details for the role + public partial interface IMonitoringMetricConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// The metrics configuration details + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The metrics configuration details", + SerializedName = @"metricConfigurations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration[] MetricConfiguration { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// The metric setting details for the role + internal partial interface IMonitoringMetricConfigurationInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// The metrics configuration details + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration[] MetricConfiguration { get; set; } + /// The metric setting properties. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationProperties Property { get; set; } + /// + /// Metadata pertaining to creation and last modification of MonitoringConfiguration + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfiguration.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfiguration.json.cs new file mode 100644 index 000000000000..076da1883731 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfiguration.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The metric setting details for the role + public partial class MonitoringMetricConfiguration + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new MonitoringMetricConfiguration(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal MonitoringMetricConfiguration(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MonitoringMetricConfigurationProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationList.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationList.PowerShell.cs new file mode 100644 index 000000000000..20b65bdef6e9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Collection of metric configurations. + [System.ComponentModel.TypeConverter(typeof(MonitoringMetricConfigurationListTypeConverter))] + public partial class MonitoringMetricConfigurationList + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MonitoringMetricConfigurationList(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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MonitoringMetricConfigurationList(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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MonitoringMetricConfigurationList(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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MonitoringMetricConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationListInternal)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 MonitoringMetricConfigurationList(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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MonitoringMetricConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationListInternal)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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of metric configurations. + [System.ComponentModel.TypeConverter(typeof(MonitoringMetricConfigurationListTypeConverter))] + public partial interface IMonitoringMetricConfigurationList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationList.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationList.TypeConverter.cs new file mode 100644 index 000000000000..9006d7a4ba61 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MonitoringMetricConfigurationListTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MonitoringMetricConfigurationList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MonitoringMetricConfigurationList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MonitoringMetricConfigurationList.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/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationList.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationList.cs new file mode 100644 index 000000000000..c47c1cd5c1b1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationList.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Collection of metric configurations. + public partial class MonitoringMetricConfigurationList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationList, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationListInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration[] _value; + + /// The list of metric configurations. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration[] Value { get => this._value; } + + /// Creates an new instance. + public MonitoringMetricConfigurationList() + { + + } + } + /// Collection of metric configurations. + public partial interface IMonitoringMetricConfigurationList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Link to the next set of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of metric configurations. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of metric configurations.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration[] Value { get; } + + } + /// Collection of metric configurations. + internal partial interface IMonitoringMetricConfigurationListInternal + + { + /// Link to the next set of results. + string NextLink { get; set; } + /// The list of metric configurations. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationList.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationList.json.cs new file mode 100644 index 000000000000..39659514a149 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationList.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Collection of metric configurations. + public partial class MonitoringMetricConfigurationList + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new MonitoringMetricConfigurationList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal MonitoringMetricConfigurationList(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MonitoringMetricConfiguration.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationProperties.PowerShell.cs new file mode 100644 index 000000000000..3bfeb4ddb815 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationProperties.PowerShell.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Metrics properties + [System.ComponentModel.TypeConverter(typeof(MonitoringMetricConfigurationPropertiesTypeConverter))] + public partial class MonitoringMetricConfigurationProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MonitoringMetricConfigurationProperties(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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MonitoringMetricConfigurationProperties(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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MonitoringMetricConfigurationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MetricConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationPropertiesInternal)this).MetricConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration[]) content.GetValueForProperty("MetricConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationPropertiesInternal)this).MetricConfiguration, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricConfigurationTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MonitoringMetricConfigurationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MetricConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationPropertiesInternal)this).MetricConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration[]) content.GetValueForProperty("MetricConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationPropertiesInternal)this).MetricConfiguration, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricConfigurationTypeConverter.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Metrics properties + [System.ComponentModel.TypeConverter(typeof(MonitoringMetricConfigurationPropertiesTypeConverter))] + public partial interface IMonitoringMetricConfigurationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationProperties.TypeConverter.cs new file mode 100644 index 000000000000..5d6d446f03f4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationProperties.TypeConverter.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MonitoringMetricConfigurationPropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MonitoringMetricConfigurationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MonitoringMetricConfigurationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MonitoringMetricConfigurationProperties.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/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationProperties.cs new file mode 100644 index 000000000000..f2ac473a2255 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Metrics properties + public partial class MonitoringMetricConfigurationProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration[] _metricConfiguration; + + /// The metrics configuration details + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration[] MetricConfiguration { get => this._metricConfiguration; set => this._metricConfiguration = value; } + + /// Creates an new instance. + public MonitoringMetricConfigurationProperties() + { + + } + } + /// Metrics properties + public partial interface IMonitoringMetricConfigurationProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The metrics configuration details + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The metrics configuration details", + SerializedName = @"metricConfigurations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration[] MetricConfiguration { get; set; } + + } + /// Metrics properties + internal partial interface IMonitoringMetricConfigurationPropertiesInternal + + { + /// The metrics configuration details + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration[] MetricConfiguration { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationProperties.json.cs new file mode 100644 index 000000000000..ad804d02493a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MonitoringMetricConfigurationProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Metrics properties + public partial class MonitoringMetricConfigurationProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfigurationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new MonitoringMetricConfigurationProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal MonitoringMetricConfigurationProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_metricConfiguration = If( json?.PropertyT("metricConfigurations"), out var __jsonMetricConfigurations) ? If( __jsonMetricConfigurations as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IMetricConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricConfiguration.FromJson(__u) )) ))() : null : MetricConfiguration;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._metricConfiguration) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._metricConfiguration ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("metricConfigurations",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MountPointMap.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MountPointMap.PowerShell.cs new file mode 100644 index 000000000000..e960bc0781c0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MountPointMap.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The share mount point. + [System.ComponentModel.TypeConverter(typeof(MountPointMapTypeConverter))] + public partial class MountPointMap + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IMountPointMap DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MountPointMap(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.DataBoxEdge.Models.Api20220301.IMountPointMap DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MountPointMap(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.DataBoxEdge.Models.Api20220301.IMountPointMap FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MountPointMap(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ShareId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).ShareId = (string) content.GetValueForProperty("ShareId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).ShareId, global::System.Convert.ToString); + } + if (content.Contains("RoleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).RoleId = (string) content.GetValueForProperty("RoleId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).RoleId, global::System.Convert.ToString); + } + if (content.Contains("MountPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).MountPoint = (string) content.GetValueForProperty("MountPoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).MountPoint, global::System.Convert.ToString); + } + if (content.Contains("MountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).MountType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MountType?) content.GetValueForProperty("MountType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).MountType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MountType.CreateFrom); + } + if (content.Contains("RoleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).RoleType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes?) content.GetValueForProperty("RoleType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).RoleType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MountPointMap(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ShareId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).ShareId = (string) content.GetValueForProperty("ShareId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).ShareId, global::System.Convert.ToString); + } + if (content.Contains("RoleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).RoleId = (string) content.GetValueForProperty("RoleId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).RoleId, global::System.Convert.ToString); + } + if (content.Contains("MountPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).MountPoint = (string) content.GetValueForProperty("MountPoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).MountPoint, global::System.Convert.ToString); + } + if (content.Contains("MountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).MountType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MountType?) content.GetValueForProperty("MountType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).MountType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MountType.CreateFrom); + } + if (content.Contains("RoleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).RoleType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes?) content.GetValueForProperty("RoleType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal)this).RoleType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The share mount point. + [System.ComponentModel.TypeConverter(typeof(MountPointMapTypeConverter))] + public partial interface IMountPointMap + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MountPointMap.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MountPointMap.TypeConverter.cs new file mode 100644 index 000000000000..4a3afdb12ac0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MountPointMap.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MountPointMapTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IMountPointMap ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MountPointMap.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MountPointMap.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MountPointMap.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/databoxedge/generated/api/Models/Api20220301/MountPointMap.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MountPointMap.cs new file mode 100644 index 000000000000..8a682efb9bd1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MountPointMap.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The share mount point. + public partial class MountPointMap : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal + { + + /// Internal Acessors for MountPoint + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal.MountPoint { get => this._mountPoint; set { {_mountPoint = value;} } } + + /// Internal Acessors for MountType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MountType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal.MountType { get => this._mountType; set { {_mountType = value;} } } + + /// Internal Acessors for RoleId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal.RoleId { get => this._roleId; set { {_roleId = value;} } } + + /// Internal Acessors for RoleType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMapInternal.RoleType { get => this._roleType; set { {_roleType = value;} } } + + /// Backing field for property. + private string _mountPoint; + + /// Mount point for the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string MountPoint { get => this._mountPoint; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MountType? _mountType; + + /// Mounting type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MountType? MountType { get => this._mountType; } + + /// Backing field for property. + private string _roleId; + + /// ID of the role to which share is mounted. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string RoleId { get => this._roleId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes? _roleType; + + /// Role type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes? RoleType { get => this._roleType; } + + /// Backing field for property. + private string _shareId; + + /// ID of the share mounted to the role VM. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ShareId { get => this._shareId; set => this._shareId = value; } + + /// Creates an new instance. + public MountPointMap() + { + + } + } + /// The share mount point. + public partial interface IMountPointMap : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Mount point for the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Mount point for the share.", + SerializedName = @"mountPoint", + PossibleTypes = new [] { typeof(string) })] + string MountPoint { get; } + /// Mounting type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Mounting type.", + SerializedName = @"mountType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MountType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MountType? MountType { get; } + /// ID of the role to which share is mounted. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"ID of the role to which share is mounted.", + SerializedName = @"roleId", + PossibleTypes = new [] { typeof(string) })] + string RoleId { get; } + /// Role type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Role type.", + SerializedName = @"roleType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes? RoleType { get; } + /// ID of the share mounted to the role VM. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"ID of the share mounted to the role VM.", + SerializedName = @"shareId", + PossibleTypes = new [] { typeof(string) })] + string ShareId { get; set; } + + } + /// The share mount point. + internal partial interface IMountPointMapInternal + + { + /// Mount point for the share. + string MountPoint { get; set; } + /// Mounting type. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MountType? MountType { get; set; } + /// ID of the role to which share is mounted. + string RoleId { get; set; } + /// Role type. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes? RoleType { get; set; } + /// ID of the share mounted to the role VM. + string ShareId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/MountPointMap.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/MountPointMap.json.cs new file mode 100644 index 000000000000..f0c53b0e982a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/MountPointMap.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The share mount point. + public partial class MountPointMap + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new MountPointMap(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal MountPointMap(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_shareId = If( json?.PropertyT("shareId"), out var __jsonShareId) ? (string)__jsonShareId : (string)ShareId;} + {_roleId = If( json?.PropertyT("roleId"), out var __jsonRoleId) ? (string)__jsonRoleId : (string)RoleId;} + {_mountPoint = If( json?.PropertyT("mountPoint"), out var __jsonMountPoint) ? (string)__jsonMountPoint : (string)MountPoint;} + {_mountType = If( json?.PropertyT("mountType"), out var __jsonMountType) ? (string)__jsonMountType : (string)MountType;} + {_roleType = If( json?.PropertyT("roleType"), out var __jsonRoleType) ? (string)__jsonRoleType : (string)RoleType;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._shareId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._shareId.ToString()) : null, "shareId" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._roleId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._roleId.ToString()) : null, "roleId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._mountPoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._mountPoint.ToString()) : null, "mountPoint" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._mountType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._mountType.ToString()) : null, "mountType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._roleType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._roleType.ToString()) : null, "roleType" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapter.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapter.PowerShell.cs new file mode 100644 index 000000000000..4e880d635ef8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapter.PowerShell.cs @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Represents the networkAdapter on a device. + [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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.INetworkAdapter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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("AdapterPosition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).AdapterPosition = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPosition) content.GetValueForProperty("AdapterPosition",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).AdapterPosition, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkAdapterPositionTypeConverter.ConvertFrom); + } + if (content.Contains("Ipv4Configuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv4Configuration = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4Config) content.GetValueForProperty("Ipv4Configuration",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv4Configuration, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Ipv4ConfigTypeConverter.ConvertFrom); + } + if (content.Contains("Ipv6Configuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6Configuration = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6Config) content.GetValueForProperty("Ipv6Configuration",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6Configuration, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Ipv6ConfigTypeConverter.ConvertFrom); + } + if (content.Contains("AdapterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).AdapterId = (string) content.GetValueForProperty("AdapterId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).AdapterId, global::System.Convert.ToString); + } + if (content.Contains("Index")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Index = (int?) content.GetValueForProperty("Index",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Index, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NodeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).NodeId = (string) content.GetValueForProperty("NodeId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).NodeId, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Label")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Label = (string) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Label, global::System.Convert.ToString); + } + if (content.Contains("MacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).MacAddress = (string) content.GetValueForProperty("MacAddress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).MacAddress, global::System.Convert.ToString); + } + if (content.Contains("LinkSpeed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).LinkSpeed = (long?) content.GetValueForProperty("LinkSpeed",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).LinkSpeed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterStatus.CreateFrom); + } + if (content.Contains("RdmaStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).RdmaStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterRdmaStatus?) content.GetValueForProperty("RdmaStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).RdmaStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterRdmaStatus.CreateFrom); + } + if (content.Contains("DhcpStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).DhcpStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterDhcpStatus?) content.GetValueForProperty("DhcpStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).DhcpStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterDhcpStatus.CreateFrom); + } + if (content.Contains("Ipv6LinkLocalAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6LinkLocalAddress = (string) content.GetValueForProperty("Ipv6LinkLocalAddress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6LinkLocalAddress, global::System.Convert.ToString); + } + if (content.Contains("DnsServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).DnsServer = (string[]) content.GetValueForProperty("DnsServer",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).DnsServer, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AdapterPositionNetworkGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).AdapterPositionNetworkGroup = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup?) content.GetValueForProperty("AdapterPositionNetworkGroup",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).AdapterPositionNetworkGroup, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup.CreateFrom); + } + if (content.Contains("AdapterPositionPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).AdapterPositionPort = (int?) content.GetValueForProperty("AdapterPositionPort",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).AdapterPositionPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Ipv4ConfigurationIPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv4ConfigurationIPAddress = (string) content.GetValueForProperty("Ipv4ConfigurationIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv4ConfigurationIPAddress, global::System.Convert.ToString); + } + if (content.Contains("Ipv4ConfigurationSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv4ConfigurationSubnet = (string) content.GetValueForProperty("Ipv4ConfigurationSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv4ConfigurationSubnet, global::System.Convert.ToString); + } + if (content.Contains("Ipv4ConfigurationGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv4ConfigurationGateway = (string) content.GetValueForProperty("Ipv4ConfigurationGateway",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv4ConfigurationGateway, global::System.Convert.ToString); + } + if (content.Contains("Ipv6ConfigurationIPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6ConfigurationIPAddress = (string) content.GetValueForProperty("Ipv6ConfigurationIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6ConfigurationIPAddress, global::System.Convert.ToString); + } + if (content.Contains("Ipv6ConfigurationPrefixLength")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6ConfigurationPrefixLength = (int?) content.GetValueForProperty("Ipv6ConfigurationPrefixLength",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6ConfigurationPrefixLength, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Ipv6ConfigurationGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6ConfigurationGateway = (string) content.GetValueForProperty("Ipv6ConfigurationGateway",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6ConfigurationGateway, 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("AdapterPosition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).AdapterPosition = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPosition) content.GetValueForProperty("AdapterPosition",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).AdapterPosition, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkAdapterPositionTypeConverter.ConvertFrom); + } + if (content.Contains("Ipv4Configuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv4Configuration = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4Config) content.GetValueForProperty("Ipv4Configuration",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv4Configuration, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Ipv4ConfigTypeConverter.ConvertFrom); + } + if (content.Contains("Ipv6Configuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6Configuration = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6Config) content.GetValueForProperty("Ipv6Configuration",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6Configuration, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Ipv6ConfigTypeConverter.ConvertFrom); + } + if (content.Contains("AdapterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).AdapterId = (string) content.GetValueForProperty("AdapterId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).AdapterId, global::System.Convert.ToString); + } + if (content.Contains("Index")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Index = (int?) content.GetValueForProperty("Index",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Index, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NodeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).NodeId = (string) content.GetValueForProperty("NodeId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).NodeId, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Label")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Label = (string) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Label, global::System.Convert.ToString); + } + if (content.Contains("MacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).MacAddress = (string) content.GetValueForProperty("MacAddress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).MacAddress, global::System.Convert.ToString); + } + if (content.Contains("LinkSpeed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).LinkSpeed = (long?) content.GetValueForProperty("LinkSpeed",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).LinkSpeed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterStatus.CreateFrom); + } + if (content.Contains("RdmaStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).RdmaStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterRdmaStatus?) content.GetValueForProperty("RdmaStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).RdmaStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterRdmaStatus.CreateFrom); + } + if (content.Contains("DhcpStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).DhcpStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterDhcpStatus?) content.GetValueForProperty("DhcpStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).DhcpStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterDhcpStatus.CreateFrom); + } + if (content.Contains("Ipv6LinkLocalAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6LinkLocalAddress = (string) content.GetValueForProperty("Ipv6LinkLocalAddress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6LinkLocalAddress, global::System.Convert.ToString); + } + if (content.Contains("DnsServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).DnsServer = (string[]) content.GetValueForProperty("DnsServer",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).DnsServer, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AdapterPositionNetworkGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).AdapterPositionNetworkGroup = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup?) content.GetValueForProperty("AdapterPositionNetworkGroup",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).AdapterPositionNetworkGroup, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup.CreateFrom); + } + if (content.Contains("AdapterPositionPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).AdapterPositionPort = (int?) content.GetValueForProperty("AdapterPositionPort",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).AdapterPositionPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Ipv4ConfigurationIPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv4ConfigurationIPAddress = (string) content.GetValueForProperty("Ipv4ConfigurationIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv4ConfigurationIPAddress, global::System.Convert.ToString); + } + if (content.Contains("Ipv4ConfigurationSubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv4ConfigurationSubnet = (string) content.GetValueForProperty("Ipv4ConfigurationSubnet",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv4ConfigurationSubnet, global::System.Convert.ToString); + } + if (content.Contains("Ipv4ConfigurationGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv4ConfigurationGateway = (string) content.GetValueForProperty("Ipv4ConfigurationGateway",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv4ConfigurationGateway, global::System.Convert.ToString); + } + if (content.Contains("Ipv6ConfigurationIPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6ConfigurationIPAddress = (string) content.GetValueForProperty("Ipv6ConfigurationIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6ConfigurationIPAddress, global::System.Convert.ToString); + } + if (content.Contains("Ipv6ConfigurationPrefixLength")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6ConfigurationPrefixLength = (int?) content.GetValueForProperty("Ipv6ConfigurationPrefixLength",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6ConfigurationPrefixLength, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Ipv6ConfigurationGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6ConfigurationGateway = (string) content.GetValueForProperty("Ipv6ConfigurationGateway",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal)this).Ipv6ConfigurationGateway, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Represents the networkAdapter on a device. + [System.ComponentModel.TypeConverter(typeof(NetworkAdapterTypeConverter))] + public partial interface INetworkAdapter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapter.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapter.TypeConverter.cs new file mode 100644 index 000000000000..b7fceddbc839 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.INetworkAdapter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/NetworkAdapter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapter.cs new file mode 100644 index 000000000000..e1e6c81a58c8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapter.cs @@ -0,0 +1,440 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Represents the networkAdapter on a device. + public partial class NetworkAdapter : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapter, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal + { + + /// Backing field for property. + private string _adapterId; + + /// Instance ID of network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string AdapterId { get => this._adapterId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPosition _adapterPosition; + + /// Hardware position of network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPosition AdapterPosition { get => (this._adapterPosition = this._adapterPosition ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkAdapterPosition()); } + + /// The network group. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup? AdapterPositionNetworkGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPositionInternal)AdapterPosition).NetworkGroup; } + + /// The port. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? AdapterPositionPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPositionInternal)AdapterPosition).Port; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterDhcpStatus? _dhcpStatus; + + /// Value indicating whether this adapter has DHCP enabled. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterDhcpStatus? DhcpStatus { get => this._dhcpStatus; set => this._dhcpStatus = value; } + + /// Backing field for property. + private string[] _dnsServer; + + /// The list of DNS Servers of the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string[] DnsServer { get => this._dnsServer; } + + /// Backing field for property. + private int? _index; + + /// Logical index of the adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? Index { get => this._index; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4Config _ipv4Configuration; + + /// The IPv4 configuration of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4Config Ipv4Configuration { get => (this._ipv4Configuration = this._ipv4Configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Ipv4Config()); } + + /// The IPv4 gateway of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Ipv4ConfigurationGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)Ipv4Configuration).Gateway; } + + /// The IPv4 address of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Ipv4ConfigurationIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)Ipv4Configuration).IPAddress; } + + /// The IPv4 subnet of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Ipv4ConfigurationSubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)Ipv4Configuration).Subnet; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6Config _ipv6Configuration; + + /// The IPv6 configuration of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6Config Ipv6Configuration { get => (this._ipv6Configuration = this._ipv6Configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Ipv6Config()); } + + /// The IPv6 gateway of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Ipv6ConfigurationGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)Ipv6Configuration).Gateway; } + + /// The IPv6 address of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Ipv6ConfigurationIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)Ipv6Configuration).IPAddress; } + + /// The IPv6 prefix of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? Ipv6ConfigurationPrefixLength { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)Ipv6Configuration).PrefixLength; } + + /// Backing field for property. + private string _ipv6LinkLocalAddress; + + /// The IPv6 local address. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Ipv6LinkLocalAddress { get => this._ipv6LinkLocalAddress; } + + /// Backing field for property. + private string _label; + + /// Hardware label for the adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Label { get => this._label; } + + /// Backing field for property. + private long? _linkSpeed; + + /// Link speed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public long? LinkSpeed { get => this._linkSpeed; } + + /// Backing field for property. + private string _macAddress; + + /// MAC address. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string MacAddress { get => this._macAddress; } + + /// Internal Acessors for AdapterId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.AdapterId { get => this._adapterId; set { {_adapterId = value;} } } + + /// Internal Acessors for AdapterPosition + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPosition Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.AdapterPosition { get => (this._adapterPosition = this._adapterPosition ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkAdapterPosition()); set { {_adapterPosition = value;} } } + + /// Internal Acessors for AdapterPositionNetworkGroup + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.AdapterPositionNetworkGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPositionInternal)AdapterPosition).NetworkGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPositionInternal)AdapterPosition).NetworkGroup = value; } + + /// Internal Acessors for AdapterPositionPort + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.AdapterPositionPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPositionInternal)AdapterPosition).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPositionInternal)AdapterPosition).Port = value; } + + /// Internal Acessors for DnsServer + string[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.DnsServer { get => this._dnsServer; set { {_dnsServer = value;} } } + + /// Internal Acessors for Index + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.Index { get => this._index; set { {_index = value;} } } + + /// Internal Acessors for Ipv4Configuration + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4Config Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.Ipv4Configuration { get => (this._ipv4Configuration = this._ipv4Configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Ipv4Config()); set { {_ipv4Configuration = value;} } } + + /// Internal Acessors for Ipv4ConfigurationGateway + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.Ipv4ConfigurationGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)Ipv4Configuration).Gateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)Ipv4Configuration).Gateway = value; } + + /// Internal Acessors for Ipv4ConfigurationIPAddress + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.Ipv4ConfigurationIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)Ipv4Configuration).IPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)Ipv4Configuration).IPAddress = value; } + + /// Internal Acessors for Ipv4ConfigurationSubnet + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.Ipv4ConfigurationSubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)Ipv4Configuration).Subnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4ConfigInternal)Ipv4Configuration).Subnet = value; } + + /// Internal Acessors for Ipv6Configuration + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6Config Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.Ipv6Configuration { get => (this._ipv6Configuration = this._ipv6Configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Ipv6Config()); set { {_ipv6Configuration = value;} } } + + /// Internal Acessors for Ipv6ConfigurationGateway + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.Ipv6ConfigurationGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)Ipv6Configuration).Gateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)Ipv6Configuration).Gateway = value; } + + /// Internal Acessors for Ipv6ConfigurationIPAddress + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.Ipv6ConfigurationIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)Ipv6Configuration).IPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)Ipv6Configuration).IPAddress = value; } + + /// Internal Acessors for Ipv6ConfigurationPrefixLength + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.Ipv6ConfigurationPrefixLength { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)Ipv6Configuration).PrefixLength; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6ConfigInternal)Ipv6Configuration).PrefixLength = value; } + + /// Internal Acessors for Ipv6LinkLocalAddress + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.Ipv6LinkLocalAddress { get => this._ipv6LinkLocalAddress; set { {_ipv6LinkLocalAddress = value;} } } + + /// Internal Acessors for Label + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.Label { get => this._label; set { {_label = value;} } } + + /// Internal Acessors for LinkSpeed + long? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.LinkSpeed { get => this._linkSpeed; set { {_linkSpeed = value;} } } + + /// Internal Acessors for MacAddress + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.MacAddress { get => this._macAddress; set { {_macAddress = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for NodeId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.NodeId { get => this._nodeId; set { {_nodeId = value;} } } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterStatus? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterInternal.Status { get => this._status; set { {_status = value;} } } + + /// Backing field for property. + private string _name; + + /// Network adapter name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _nodeId; + + /// Node ID of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NodeId { get => this._nodeId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterRdmaStatus? _rdmaStatus; + + /// Value indicating whether this adapter is RDMA capable. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterRdmaStatus? RdmaStatus { get => this._rdmaStatus; set => this._rdmaStatus = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterStatus? _status; + + /// Value indicating whether this adapter is valid. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterStatus? Status { get => this._status; } + + /// Creates an new instance. + public NetworkAdapter() + { + + } + } + /// Represents the networkAdapter on a device. + public partial interface INetworkAdapter : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Instance ID of network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Instance ID of network adapter.", + SerializedName = @"adapterId", + PossibleTypes = new [] { typeof(string) })] + string AdapterId { get; } + /// The network group. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The network group.", + SerializedName = @"networkGroup", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup? AdapterPositionNetworkGroup { get; } + /// The port. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The port.", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? AdapterPositionPort { get; } + /// Value indicating whether this adapter has DHCP enabled. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating whether this adapter has DHCP enabled.", + SerializedName = @"dhcpStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterDhcpStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterDhcpStatus? DhcpStatus { get; set; } + /// The list of DNS Servers of the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of DNS Servers of the device.", + SerializedName = @"dnsServers", + PossibleTypes = new [] { typeof(string) })] + string[] DnsServer { get; } + /// Logical index of the adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Logical index of the adapter.", + SerializedName = @"index", + PossibleTypes = new [] { typeof(int) })] + int? Index { get; } + /// The IPv4 gateway of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The IPv4 gateway of the network adapter.", + SerializedName = @"gateway", + PossibleTypes = new [] { typeof(string) })] + string Ipv4ConfigurationGateway { get; } + /// The IPv4 address of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The IPv4 address of the network adapter.", + SerializedName = @"ipAddress", + PossibleTypes = new [] { typeof(string) })] + string Ipv4ConfigurationIPAddress { get; } + /// The IPv4 subnet of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The IPv4 subnet of the network adapter.", + SerializedName = @"subnet", + PossibleTypes = new [] { typeof(string) })] + string Ipv4ConfigurationSubnet { get; } + /// The IPv6 gateway of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The IPv6 gateway of the network adapter.", + SerializedName = @"gateway", + PossibleTypes = new [] { typeof(string) })] + string Ipv6ConfigurationGateway { get; } + /// The IPv6 address of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The IPv6 address of the network adapter.", + SerializedName = @"ipAddress", + PossibleTypes = new [] { typeof(string) })] + string Ipv6ConfigurationIPAddress { get; } + /// The IPv6 prefix of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The IPv6 prefix of the network adapter.", + SerializedName = @"prefixLength", + PossibleTypes = new [] { typeof(int) })] + int? Ipv6ConfigurationPrefixLength { get; } + /// The IPv6 local address. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The IPv6 local address.", + SerializedName = @"ipv6LinkLocalAddress", + PossibleTypes = new [] { typeof(string) })] + string Ipv6LinkLocalAddress { get; } + /// Hardware label for the adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Hardware label for the adapter.", + SerializedName = @"label", + PossibleTypes = new [] { typeof(string) })] + string Label { get; } + /// Link speed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Link speed.", + SerializedName = @"linkSpeed", + PossibleTypes = new [] { typeof(long) })] + long? LinkSpeed { get; } + /// MAC address. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"MAC address.", + SerializedName = @"macAddress", + PossibleTypes = new [] { typeof(string) })] + string MacAddress { get; } + /// Network adapter name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Network adapter name.", + SerializedName = @"networkAdapterName", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Node ID of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Node ID of the network adapter.", + SerializedName = @"nodeId", + PossibleTypes = new [] { typeof(string) })] + string NodeId { get; } + /// Value indicating whether this adapter is RDMA capable. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating whether this adapter is RDMA capable.", + SerializedName = @"rdmaStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterRdmaStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterRdmaStatus? RdmaStatus { get; set; } + /// Value indicating whether this adapter is valid. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Value indicating whether this adapter is valid.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterStatus? Status { get; } + + } + /// Represents the networkAdapter on a device. + internal partial interface INetworkAdapterInternal + + { + /// Instance ID of network adapter. + string AdapterId { get; set; } + /// Hardware position of network adapter. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPosition AdapterPosition { get; set; } + /// The network group. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup? AdapterPositionNetworkGroup { get; set; } + /// The port. + int? AdapterPositionPort { get; set; } + /// Value indicating whether this adapter has DHCP enabled. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterDhcpStatus? DhcpStatus { get; set; } + /// The list of DNS Servers of the device. + string[] DnsServer { get; set; } + /// Logical index of the adapter. + int? Index { get; set; } + /// The IPv4 configuration of the network adapter. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv4Config Ipv4Configuration { get; set; } + /// The IPv4 gateway of the network adapter. + string Ipv4ConfigurationGateway { get; set; } + /// The IPv4 address of the network adapter. + string Ipv4ConfigurationIPAddress { get; set; } + /// The IPv4 subnet of the network adapter. + string Ipv4ConfigurationSubnet { get; set; } + /// The IPv6 configuration of the network adapter. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IIpv6Config Ipv6Configuration { get; set; } + /// The IPv6 gateway of the network adapter. + string Ipv6ConfigurationGateway { get; set; } + /// The IPv6 address of the network adapter. + string Ipv6ConfigurationIPAddress { get; set; } + /// The IPv6 prefix of the network adapter. + int? Ipv6ConfigurationPrefixLength { get; set; } + /// The IPv6 local address. + string Ipv6LinkLocalAddress { get; set; } + /// Hardware label for the adapter. + string Label { get; set; } + /// Link speed. + long? LinkSpeed { get; set; } + /// MAC address. + string MacAddress { get; set; } + /// Network adapter name. + string Name { get; set; } + /// Node ID of the network adapter. + string NodeId { get; set; } + /// Value indicating whether this adapter is RDMA capable. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterRdmaStatus? RdmaStatus { get; set; } + /// Value indicating whether this adapter is valid. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterStatus? Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapter.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapter.json.cs new file mode 100644 index 000000000000..af20b8653026 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapter.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Represents the networkAdapter on a device. + 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapter FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new NetworkAdapter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal NetworkAdapter(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_adapterPosition = If( json?.PropertyT("adapterPosition"), out var __jsonAdapterPosition) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkAdapterPosition.FromJson(__jsonAdapterPosition) : AdapterPosition;} + {_ipv4Configuration = If( json?.PropertyT("ipv4Configuration"), out var __jsonIpv4Configuration) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Ipv4Config.FromJson(__jsonIpv4Configuration) : Ipv4Configuration;} + {_ipv6Configuration = If( json?.PropertyT("ipv6Configuration"), out var __jsonIpv6Configuration) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Ipv6Config.FromJson(__jsonIpv6Configuration) : Ipv6Configuration;} + {_adapterId = If( json?.PropertyT("adapterId"), out var __jsonAdapterId) ? (string)__jsonAdapterId : (string)AdapterId;} + {_index = If( json?.PropertyT("index"), out var __jsonIndex) ? (int?)__jsonIndex : Index;} + {_nodeId = If( json?.PropertyT("nodeId"), out var __jsonNodeId) ? (string)__jsonNodeId : (string)NodeId;} + {_name = If( json?.PropertyT("networkAdapterName"), out var __jsonNetworkAdapterName) ? (string)__jsonNetworkAdapterName : (string)Name;} + {_label = If( json?.PropertyT("label"), out var __jsonLabel) ? (string)__jsonLabel : (string)Label;} + {_macAddress = If( json?.PropertyT("macAddress"), out var __jsonMacAddress) ? (string)__jsonMacAddress : (string)MacAddress;} + {_linkSpeed = If( json?.PropertyT("linkSpeed"), out var __jsonLinkSpeed) ? (long?)__jsonLinkSpeed : LinkSpeed;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_rdmaStatus = If( json?.PropertyT("rdmaStatus"), out var __jsonRdmaStatus) ? (string)__jsonRdmaStatus : (string)RdmaStatus;} + {_dhcpStatus = If( json?.PropertyT("dhcpStatus"), out var __jsonDhcpStatus) ? (string)__jsonDhcpStatus : (string)DhcpStatus;} + {_ipv6LinkLocalAddress = If( json?.PropertyT("ipv6LinkLocalAddress"), out var __jsonIpv6LinkLocalAddress) ? (string)__jsonIpv6LinkLocalAddress : (string)Ipv6LinkLocalAddress;} + {_dnsServer = If( json?.PropertyT("dnsServers"), out var __jsonDnsServers) ? If( __jsonDnsServers as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : DnsServer;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._adapterPosition ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._adapterPosition.ToJson(null,serializationMode) : null, "adapterPosition" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._ipv4Configuration ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._ipv4Configuration.ToJson(null,serializationMode) : null, "ipv4Configuration" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._ipv6Configuration ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._ipv6Configuration.ToJson(null,serializationMode) : null, "ipv6Configuration" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._adapterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._adapterId.ToString()) : null, "adapterId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._index ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._index) : null, "index" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nodeId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._nodeId.ToString()) : null, "nodeId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._name.ToString()) : null, "networkAdapterName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._label)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._label.ToString()) : null, "label" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._macAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._macAddress.ToString()) : null, "macAddress" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._linkSpeed ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((long)this._linkSpeed) : null, "linkSpeed" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + } + AddIf( null != (((object)this._rdmaStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._rdmaStatus.ToString()) : null, "rdmaStatus" ,container.Add ); + AddIf( null != (((object)this._dhcpStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._dhcpStatus.ToString()) : null, "dhcpStatus" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._ipv6LinkLocalAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._ipv6LinkLocalAddress.ToString()) : null, "ipv6LinkLocalAddress" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._dnsServer) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._dnsServer ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("dnsServers",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapterPosition.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapterPosition.PowerShell.cs new file mode 100644 index 000000000000..3ca44e141b9d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapterPosition.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The network adapter position. + [System.ComponentModel.TypeConverter(typeof(NetworkAdapterPositionTypeConverter))] + public partial class NetworkAdapterPosition + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.INetworkAdapterPosition DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NetworkAdapterPosition(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.DataBoxEdge.Models.Api20220301.INetworkAdapterPosition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NetworkAdapterPosition(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.DataBoxEdge.Models.Api20220301.INetworkAdapterPosition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NetworkAdapterPosition(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NetworkGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPositionInternal)this).NetworkGroup = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup?) content.GetValueForProperty("NetworkGroup",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPositionInternal)this).NetworkGroup, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup.CreateFrom); + } + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPositionInternal)this).Port = (int?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPositionInternal)this).Port, (__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 NetworkAdapterPosition(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NetworkGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPositionInternal)this).NetworkGroup = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup?) content.GetValueForProperty("NetworkGroup",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPositionInternal)this).NetworkGroup, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup.CreateFrom); + } + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPositionInternal)this).Port = (int?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPositionInternal)this).Port, (__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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The network adapter position. + [System.ComponentModel.TypeConverter(typeof(NetworkAdapterPositionTypeConverter))] + public partial interface INetworkAdapterPosition + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapterPosition.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapterPosition.TypeConverter.cs new file mode 100644 index 000000000000..20ffa6d03956 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapterPosition.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NetworkAdapterPositionTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.INetworkAdapterPosition ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPosition).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NetworkAdapterPosition.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NetworkAdapterPosition.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NetworkAdapterPosition.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/databoxedge/generated/api/Models/Api20220301/NetworkAdapterPosition.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapterPosition.cs new file mode 100644 index 000000000000..a1fae5f71f7c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapterPosition.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The network adapter position. + public partial class NetworkAdapterPosition : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPosition, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPositionInternal + { + + /// Internal Acessors for NetworkGroup + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPositionInternal.NetworkGroup { get => this._networkGroup; set { {_networkGroup = value;} } } + + /// Internal Acessors for Port + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPositionInternal.Port { get => this._port; set { {_port = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup? _networkGroup; + + /// The network group. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup? NetworkGroup { get => this._networkGroup; } + + /// Backing field for property. + private int? _port; + + /// The port. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? Port { get => this._port; } + + /// Creates an new instance. + public NetworkAdapterPosition() + { + + } + } + /// The network adapter position. + public partial interface INetworkAdapterPosition : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The network group. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The network group.", + SerializedName = @"networkGroup", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup? NetworkGroup { get; } + /// The port. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The port.", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? Port { get; } + + } + /// The network adapter position. + internal partial interface INetworkAdapterPositionInternal + + { + /// The network group. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup? NetworkGroup { get; set; } + /// The port. + int? Port { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapterPosition.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapterPosition.json.cs new file mode 100644 index 000000000000..a2df2be1505d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkAdapterPosition.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The network adapter position. + public partial class NetworkAdapterPosition + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPosition. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPosition. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapterPosition FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new NetworkAdapterPosition(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal NetworkAdapterPosition(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_networkGroup = If( json?.PropertyT("networkGroup"), out var __jsonNetworkGroup) ? (string)__jsonNetworkGroup : (string)NetworkGroup;} + {_port = If( json?.PropertyT("port"), out var __jsonPort) ? (int?)__jsonPort : Port;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._networkGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._networkGroup.ToString()) : null, "networkGroup" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._port ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._port) : null, "port" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettings.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettings.PowerShell.cs new file mode 100644 index 000000000000..001e515e1309 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettings.PowerShell.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The network settings 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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.INetworkSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkSettingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("NetworkAdapter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).NetworkAdapter = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapter[]) content.GetValueForProperty("NetworkAdapter",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).NetworkAdapter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkAdapterTypeConverter.ConvertFrom)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataLastModifiedAt, (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 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.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkSettingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("NetworkAdapter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).NetworkAdapter = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapter[]) content.GetValueForProperty("NetworkAdapter",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).NetworkAdapter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkAdapterTypeConverter.ConvertFrom)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal)this).SystemDataLastModifiedAt, (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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The network settings of a device. + [System.ComponentModel.TypeConverter(typeof(NetworkSettingsTypeConverter))] + public partial interface INetworkSettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettings.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettings.TypeConverter.cs new file mode 100644 index 000000000000..b26919c81925 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.INetworkSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/NetworkSettings.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettings.cs new file mode 100644 index 000000000000..f00628413624 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettings.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The network settings of a device. + public partial class NetworkSettings : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettings, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for NetworkAdapter + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapter[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal.NetworkAdapter { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsPropertiesInternal)Property).NetworkAdapter; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsPropertiesInternal)Property).NetworkAdapter = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkSettingsProperties()); set { {_property = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// The network adapter list on the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapter[] NetworkAdapter { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsPropertiesInternal)Property).NetworkAdapter; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsProperties _property; + + /// The properties of network settings of a device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkSettingsProperties()); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of NetworkSettings + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Creates an new instance. + public NetworkSettings() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// The network settings of a device. + public partial interface INetworkSettings : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// The network adapter list on the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The network adapter list on the device.", + SerializedName = @"networkAdapters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapter) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapter[] NetworkAdapter { get; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// The network settings of a device. + internal partial interface INetworkSettingsInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// The network adapter list on the device. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapter[] NetworkAdapter { get; set; } + /// The properties of network settings of a device. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsProperties Property { get; set; } + /// Metadata pertaining to creation and last modification of NetworkSettings + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettings.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettings.json.cs new file mode 100644 index 000000000000..22af5bc7c821 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettings.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The network settings 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new NetworkSettings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal NetworkSettings(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkSettingsProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettingsProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettingsProperties.PowerShell.cs new file mode 100644 index 000000000000..565995177da6 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettingsProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The properties of network settings. + [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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.INetworkSettingsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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("NetworkAdapter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsPropertiesInternal)this).NetworkAdapter = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapter[]) content.GetValueForProperty("NetworkAdapter",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsPropertiesInternal)this).NetworkAdapter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NetworkAdapterTypeConverter.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("NetworkAdapter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsPropertiesInternal)this).NetworkAdapter = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapter[]) content.GetValueForProperty("NetworkAdapter",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsPropertiesInternal)this).NetworkAdapter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of network settings. + [System.ComponentModel.TypeConverter(typeof(NetworkSettingsPropertiesTypeConverter))] + public partial interface INetworkSettingsProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettingsProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettingsProperties.TypeConverter.cs new file mode 100644 index 000000000000..65525003c71b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.INetworkSettingsProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/NetworkSettingsProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettingsProperties.cs new file mode 100644 index 000000000000..21805549a6ef --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettingsProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The properties of network settings. + public partial class NetworkSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsPropertiesInternal + { + + /// Internal Acessors for NetworkAdapter + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapter[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsPropertiesInternal.NetworkAdapter { get => this._networkAdapter; set { {_networkAdapter = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapter[] _networkAdapter; + + /// The network adapter list on the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapter[] NetworkAdapter { get => this._networkAdapter; } + + /// Creates an new instance. + public NetworkSettingsProperties() + { + + } + } + /// The properties of network settings. + public partial interface INetworkSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The network adapter list on the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The network adapter list on the device.", + SerializedName = @"networkAdapters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapter) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapter[] NetworkAdapter { get; } + + } + /// The properties of network settings. + internal partial interface INetworkSettingsPropertiesInternal + + { + /// The network adapter list on the device. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkAdapter[] NetworkAdapter { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettingsProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettingsProperties.json.cs new file mode 100644 index 000000000000..734ad15e1ab8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NetworkSettingsProperties.json.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The properties of network settings. + 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettingsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new NetworkSettingsProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal NetworkSettingsProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.INetworkAdapter) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._networkAdapter) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/Node.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Node.PowerShell.cs new file mode 100644 index 000000000000..eed0480a5ec0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Node.PowerShell.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// Represents a single node in a Data box Edge/Gateway device + /// Gateway devices, standalone Edge devices and a single node cluster Edge device will all have 1 node + /// Multi-node Edge devices will have more than 1 nodes + /// + [System.ComponentModel.TypeConverter(typeof(NodeTypeConverter))] + public partial class Node + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.INode DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Node(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.DataBoxEdge.Models.Api20220301.INode DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Node(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.DataBoxEdge.Models.Api20220301.INode FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Node(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.DataBoxEdge.Models.Api20220301.INodeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus.CreateFrom); + } + if (content.Contains("ChassisSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).ChassisSerialNumber = (string) content.GetValueForProperty("ChassisSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).ChassisSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("FriendlySoftwareVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).FriendlySoftwareVersion = (string) content.GetValueForProperty("FriendlySoftwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).FriendlySoftwareVersion, global::System.Convert.ToString); + } + if (content.Contains("HcsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).HcsVersion = (string) content.GetValueForProperty("HcsVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).HcsVersion, global::System.Convert.ToString); + } + if (content.Contains("InstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).InstanceId = (string) content.GetValueForProperty("InstanceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).InstanceId, 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 Node(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.DataBoxEdge.Models.Api20220301.INodeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus.CreateFrom); + } + if (content.Contains("ChassisSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).ChassisSerialNumber = (string) content.GetValueForProperty("ChassisSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).ChassisSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("FriendlySoftwareVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).FriendlySoftwareVersion = (string) content.GetValueForProperty("FriendlySoftwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).FriendlySoftwareVersion, global::System.Convert.ToString); + } + if (content.Contains("HcsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).HcsVersion = (string) content.GetValueForProperty("HcsVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).HcsVersion, global::System.Convert.ToString); + } + if (content.Contains("InstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).InstanceId = (string) content.GetValueForProperty("InstanceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal)this).InstanceId, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Represents a single node in a Data box Edge/Gateway device + /// Gateway devices, standalone Edge devices and a single node cluster Edge device will all have 1 node + /// Multi-node Edge devices will have more than 1 nodes + [System.ComponentModel.TypeConverter(typeof(NodeTypeConverter))] + public partial interface INode + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Node.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Node.TypeConverter.cs new file mode 100644 index 000000000000..868642060026 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Node.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NodeTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.INode ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INode).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Node.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Node.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Node.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/databoxedge/generated/api/Models/Api20220301/Node.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Node.cs new file mode 100644 index 000000000000..f707528be7f0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Node.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// Represents a single node in a Data box Edge/Gateway device + /// Gateway devices, standalone Edge devices and a single node cluster Edge device will all have 1 node + /// Multi-node Edge devices will have more than 1 nodes + /// + public partial class Node : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INode, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// Serial number of the Chassis + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ChassisSerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeChassisSerialNumber; } + + /// Display Name of the individual node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeDisplayName; } + + /// Friendly software version name that is currently installed on the node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string FriendlySoftwareVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeFriendlySoftwareVersion; } + + /// HCS version that is currently installed on the node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string HcsVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeHcsVersion; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// Guid instance id of the node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string InstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeInstanceId; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for ChassisSerialNumber + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal.ChassisSerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeChassisSerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeChassisSerialNumber = value; } + + /// Internal Acessors for DisplayName + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal.DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeDisplayName = value; } + + /// Internal Acessors for FriendlySoftwareVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal.FriendlySoftwareVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeFriendlySoftwareVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeFriendlySoftwareVersion = value; } + + /// Internal Acessors for HcsVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal.HcsVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeHcsVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeHcsVersion = value; } + + /// Internal Acessors for InstanceId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal.InstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeInstanceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeInstanceId = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodeProperties()); set { {_property = value;} } } + + /// Internal Acessors for SerialNumber + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal.SerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeSerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeSerialNumber = value; } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeStatus = value; } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeProperties _property; + + /// The properties of the node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodeProperties()); } + + /// Serial number of the individual node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeSerialNumber; } + + /// The current status of the individual node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)Property).NodeStatus; } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Creates an new instance. + public Node() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// Represents a single node in a Data box Edge/Gateway device + /// Gateway devices, standalone Edge devices and a single node cluster Edge device will all have 1 node + /// Multi-node Edge devices will have more than 1 nodes + public partial interface INode : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// Serial number of the Chassis + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Serial number of the Chassis", + SerializedName = @"nodeChassisSerialNumber", + PossibleTypes = new [] { typeof(string) })] + string ChassisSerialNumber { get; } + /// Display Name of the individual node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Display Name of the individual node", + SerializedName = @"nodeDisplayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; } + /// Friendly software version name that is currently installed on the node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Friendly software version name that is currently installed on the node", + SerializedName = @"nodeFriendlySoftwareVersion", + PossibleTypes = new [] { typeof(string) })] + string FriendlySoftwareVersion { get; } + /// HCS version that is currently installed on the node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"HCS version that is currently installed on the node", + SerializedName = @"nodeHcsVersion", + PossibleTypes = new [] { typeof(string) })] + string HcsVersion { get; } + /// Guid instance id of the node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Guid instance id of the node", + SerializedName = @"nodeInstanceId", + PossibleTypes = new [] { typeof(string) })] + string InstanceId { get; } + /// Serial number of the individual node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Serial number of the individual node", + SerializedName = @"nodeSerialNumber", + PossibleTypes = new [] { typeof(string) })] + string SerialNumber { get; } + /// The current status of the individual node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current status of the individual node", + SerializedName = @"nodeStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus? Status { get; } + + } + /// Represents a single node in a Data box Edge/Gateway device + /// Gateway devices, standalone Edge devices and a single node cluster Edge device will all have 1 node + /// Multi-node Edge devices will have more than 1 nodes + internal partial interface INodeInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// Serial number of the Chassis + string ChassisSerialNumber { get; set; } + /// Display Name of the individual node + string DisplayName { get; set; } + /// Friendly software version name that is currently installed on the node + string FriendlySoftwareVersion { get; set; } + /// HCS version that is currently installed on the node + string HcsVersion { get; set; } + /// Guid instance id of the node + string InstanceId { get; set; } + /// The properties of the node + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeProperties Property { get; set; } + /// Serial number of the individual node + string SerialNumber { get; set; } + /// The current status of the individual node + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus? Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Node.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Node.json.cs new file mode 100644 index 000000000000..66e92dec8728 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Node.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// Represents a single node in a Data box Edge/Gateway device + /// Gateway devices, standalone Edge devices and a single node cluster Edge device will all have 1 node + /// Multi-node Edge devices will have more than 1 nodes + /// + public partial class Node + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INode. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INode. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INode FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new Node(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal Node(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodeProperties.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/NodeInfo.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeInfo.PowerShell.cs new file mode 100644 index 000000000000..8411d3a2b559 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeInfo.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Kubernetes node info + [System.ComponentModel.TypeConverter(typeof(NodeInfoTypeConverter))] + public partial class NodeInfo + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.INodeInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NodeInfo(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.DataBoxEdge.Models.Api20220301.INodeInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NodeInfo(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.DataBoxEdge.Models.Api20220301.INodeInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NodeInfo(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.DataBoxEdge.Models.Api20220301.INodeInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfoInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesNodeType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfoInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesNodeType.CreateFrom); + } + if (content.Contains("IPConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfoInternal)this).IPConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfiguration[]) content.GetValueForProperty("IPConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfoInternal)this).IPConfiguration, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesIPConfigurationTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NodeInfo(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.DataBoxEdge.Models.Api20220301.INodeInfoInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfoInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfoInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesNodeType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfoInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesNodeType.CreateFrom); + } + if (content.Contains("IPConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfoInternal)this).IPConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfiguration[]) content.GetValueForProperty("IPConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfoInternal)this).IPConfiguration, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesIPConfigurationTypeConverter.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Kubernetes node info + [System.ComponentModel.TypeConverter(typeof(NodeInfoTypeConverter))] + public partial interface INodeInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeInfo.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeInfo.TypeConverter.cs new file mode 100644 index 000000000000..68d2a174cd8e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NodeInfoTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.INodeInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NodeInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NodeInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NodeInfo.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/databoxedge/generated/api/Models/Api20220301/NodeInfo.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeInfo.cs new file mode 100644 index 000000000000..6690dd080060 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeInfo.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Kubernetes node info + public partial class NodeInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfiguration[] _iPConfiguration; + + /// IP Configuration of the Kubernetes node. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfiguration[] IPConfiguration { get => this._iPConfiguration; set => this._iPConfiguration = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfoInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Type + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesNodeType? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfoInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// Node name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesNodeType? _type; + + /// Node type - Master/Worker + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesNodeType? Type { get => this._type; } + + /// Creates an new instance. + public NodeInfo() + { + + } + } + /// Kubernetes node info + public partial interface INodeInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// IP Configuration of the Kubernetes node. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"IP Configuration of the Kubernetes node.", + SerializedName = @"ipConfiguration", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfiguration) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfiguration[] IPConfiguration { get; set; } + /// Node name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Node name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Node type - Master/Worker + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Node type - Master/Worker", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesNodeType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesNodeType? Type { get; } + + } + /// Kubernetes node info + internal partial interface INodeInfoInternal + + { + /// IP Configuration of the Kubernetes node. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IKubernetesIPConfiguration[] IPConfiguration { get; set; } + /// Node name. + string Name { get; set; } + /// Node type - Master/Worker + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesNodeType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeInfo.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeInfo.json.cs new file mode 100644 index 000000000000..948414b157c8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeInfo.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Kubernetes node info + public partial class NodeInfo + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new NodeInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal NodeInfo(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_iPConfiguration = If( json?.PropertyT("ipConfiguration"), out var __jsonIPConfiguration) ? If( __jsonIPConfiguration as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IKubernetesIPConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.KubernetesIPConfiguration.FromJson(__u) )) ))() : null : IPConfiguration;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + if (null != this._iPConfiguration) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._iPConfiguration ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("ipConfiguration",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeList.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeList.PowerShell.cs new file mode 100644 index 000000000000..7952caf3cfa1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Collection of Nodes. + [System.ComponentModel.TypeConverter(typeof(NodeListTypeConverter))] + public partial class NodeList + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.INodeList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NodeList(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.DataBoxEdge.Models.Api20220301.INodeList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NodeList(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.DataBoxEdge.Models.Api20220301.INodeList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NodeList(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.DataBoxEdge.Models.Api20220301.INodeListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INode[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodeTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeListInternal)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 NodeList(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.DataBoxEdge.Models.Api20220301.INodeListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INode[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.NodeTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeListInternal)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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of Nodes. + [System.ComponentModel.TypeConverter(typeof(NodeListTypeConverter))] + public partial interface INodeList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeList.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeList.TypeConverter.cs new file mode 100644 index 000000000000..10a269844fd0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NodeListTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.INodeList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NodeList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NodeList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NodeList.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/databoxedge/generated/api/Models/Api20220301/NodeList.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeList.cs new file mode 100644 index 000000000000..64aff093134b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeList.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Collection of Nodes. + public partial class NodeList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeList, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INode[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeListInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INode[] _value; + + /// The list of Nodes. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INode[] Value { get => this._value; } + + /// Creates an new instance. + public NodeList() + { + + } + } + /// Collection of Nodes. + public partial interface INodeList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Link to the next set of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of Nodes. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of Nodes.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INode) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INode[] Value { get; } + + } + /// Collection of Nodes. + internal partial interface INodeListInternal + + { + /// Link to the next set of results. + string NextLink { get; set; } + /// The list of Nodes. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INode[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeList.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeList.json.cs new file mode 100644 index 000000000000..63f2841cba63 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeList.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Collection of Nodes. + public partial class NodeList + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new NodeList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal NodeList(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.INode) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Node.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/NodeProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeProperties.PowerShell.cs new file mode 100644 index 000000000000..26514a1b531c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeProperties.PowerShell.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// This class represents the nodes in a highly available cluster + [System.ComponentModel.TypeConverter(typeof(NodePropertiesTypeConverter))] + public partial class NodeProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.INodeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NodeProperties(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.DataBoxEdge.Models.Api20220301.INodeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NodeProperties(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.DataBoxEdge.Models.Api20220301.INodeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NodeProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NodeStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus?) content.GetValueForProperty("NodeStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus.CreateFrom); + } + if (content.Contains("NodeChassisSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeChassisSerialNumber = (string) content.GetValueForProperty("NodeChassisSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeChassisSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("NodeSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeSerialNumber = (string) content.GetValueForProperty("NodeSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("NodeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeDisplayName = (string) content.GetValueForProperty("NodeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("NodeFriendlySoftwareVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeFriendlySoftwareVersion = (string) content.GetValueForProperty("NodeFriendlySoftwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeFriendlySoftwareVersion, global::System.Convert.ToString); + } + if (content.Contains("NodeHcsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeHcsVersion = (string) content.GetValueForProperty("NodeHcsVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeHcsVersion, global::System.Convert.ToString); + } + if (content.Contains("NodeInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeInstanceId = (string) content.GetValueForProperty("NodeInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeInstanceId, 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 NodeProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NodeStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus?) content.GetValueForProperty("NodeStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus.CreateFrom); + } + if (content.Contains("NodeChassisSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeChassisSerialNumber = (string) content.GetValueForProperty("NodeChassisSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeChassisSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("NodeSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeSerialNumber = (string) content.GetValueForProperty("NodeSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("NodeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeDisplayName = (string) content.GetValueForProperty("NodeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("NodeFriendlySoftwareVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeFriendlySoftwareVersion = (string) content.GetValueForProperty("NodeFriendlySoftwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeFriendlySoftwareVersion, global::System.Convert.ToString); + } + if (content.Contains("NodeHcsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeHcsVersion = (string) content.GetValueForProperty("NodeHcsVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeHcsVersion, global::System.Convert.ToString); + } + if (content.Contains("NodeInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeInstanceId = (string) content.GetValueForProperty("NodeInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal)this).NodeInstanceId, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// This class represents the nodes in a highly available cluster + [System.ComponentModel.TypeConverter(typeof(NodePropertiesTypeConverter))] + public partial interface INodeProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeProperties.TypeConverter.cs new file mode 100644 index 000000000000..2176ef6b6ece --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NodePropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.INodeProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NodeProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NodeProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NodeProperties.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/databoxedge/generated/api/Models/Api20220301/NodeProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeProperties.cs new file mode 100644 index 000000000000..01cd12f628a0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// This class represents the nodes in a highly available cluster + public partial class NodeProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal + { + + /// Internal Acessors for NodeChassisSerialNumber + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal.NodeChassisSerialNumber { get => this._nodeChassisSerialNumber; set { {_nodeChassisSerialNumber = value;} } } + + /// Internal Acessors for NodeDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal.NodeDisplayName { get => this._nodeDisplayName; set { {_nodeDisplayName = value;} } } + + /// Internal Acessors for NodeFriendlySoftwareVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal.NodeFriendlySoftwareVersion { get => this._nodeFriendlySoftwareVersion; set { {_nodeFriendlySoftwareVersion = value;} } } + + /// Internal Acessors for NodeHcsVersion + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal.NodeHcsVersion { get => this._nodeHcsVersion; set { {_nodeHcsVersion = value;} } } + + /// Internal Acessors for NodeInstanceId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal.NodeInstanceId { get => this._nodeInstanceId; set { {_nodeInstanceId = value;} } } + + /// Internal Acessors for NodeSerialNumber + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal.NodeSerialNumber { get => this._nodeSerialNumber; set { {_nodeSerialNumber = value;} } } + + /// Internal Acessors for NodeStatus + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodePropertiesInternal.NodeStatus { get => this._nodeStatus; set { {_nodeStatus = value;} } } + + /// Backing field for property. + private string _nodeChassisSerialNumber; + + /// Serial number of the Chassis + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NodeChassisSerialNumber { get => this._nodeChassisSerialNumber; } + + /// Backing field for property. + private string _nodeDisplayName; + + /// Display Name of the individual node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NodeDisplayName { get => this._nodeDisplayName; } + + /// Backing field for property. + private string _nodeFriendlySoftwareVersion; + + /// Friendly software version name that is currently installed on the node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NodeFriendlySoftwareVersion { get => this._nodeFriendlySoftwareVersion; } + + /// Backing field for property. + private string _nodeHcsVersion; + + /// HCS version that is currently installed on the node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NodeHcsVersion { get => this._nodeHcsVersion; } + + /// Backing field for property. + private string _nodeInstanceId; + + /// Guid instance id of the node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NodeInstanceId { get => this._nodeInstanceId; } + + /// Backing field for property. + private string _nodeSerialNumber; + + /// Serial number of the individual node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NodeSerialNumber { get => this._nodeSerialNumber; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus? _nodeStatus; + + /// The current status of the individual node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus? NodeStatus { get => this._nodeStatus; } + + /// Creates an new instance. + public NodeProperties() + { + + } + } + /// This class represents the nodes in a highly available cluster + public partial interface INodeProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Serial number of the Chassis + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Serial number of the Chassis", + SerializedName = @"nodeChassisSerialNumber", + PossibleTypes = new [] { typeof(string) })] + string NodeChassisSerialNumber { get; } + /// Display Name of the individual node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Display Name of the individual node", + SerializedName = @"nodeDisplayName", + PossibleTypes = new [] { typeof(string) })] + string NodeDisplayName { get; } + /// Friendly software version name that is currently installed on the node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Friendly software version name that is currently installed on the node", + SerializedName = @"nodeFriendlySoftwareVersion", + PossibleTypes = new [] { typeof(string) })] + string NodeFriendlySoftwareVersion { get; } + /// HCS version that is currently installed on the node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"HCS version that is currently installed on the node", + SerializedName = @"nodeHcsVersion", + PossibleTypes = new [] { typeof(string) })] + string NodeHcsVersion { get; } + /// Guid instance id of the node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Guid instance id of the node", + SerializedName = @"nodeInstanceId", + PossibleTypes = new [] { typeof(string) })] + string NodeInstanceId { get; } + /// Serial number of the individual node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Serial number of the individual node", + SerializedName = @"nodeSerialNumber", + PossibleTypes = new [] { typeof(string) })] + string NodeSerialNumber { get; } + /// The current status of the individual node + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current status of the individual node", + SerializedName = @"nodeStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus? NodeStatus { get; } + + } + /// This class represents the nodes in a highly available cluster + internal partial interface INodePropertiesInternal + + { + /// Serial number of the Chassis + string NodeChassisSerialNumber { get; set; } + /// Display Name of the individual node + string NodeDisplayName { get; set; } + /// Friendly software version name that is currently installed on the node + string NodeFriendlySoftwareVersion { get; set; } + /// HCS version that is currently installed on the node + string NodeHcsVersion { get; set; } + /// Guid instance id of the node + string NodeInstanceId { get; set; } + /// Serial number of the individual node + string NodeSerialNumber { get; set; } + /// The current status of the individual node + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus? NodeStatus { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeProperties.json.cs new file mode 100644 index 000000000000..fdbeb8e41977 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NodeProperties.json.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// This class represents the nodes in a highly available cluster + public partial class NodeProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INodeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new NodeProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal NodeProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_nodeStatus = If( json?.PropertyT("nodeStatus"), out var __jsonNodeStatus) ? (string)__jsonNodeStatus : (string)NodeStatus;} + {_nodeChassisSerialNumber = If( json?.PropertyT("nodeChassisSerialNumber"), out var __jsonNodeChassisSerialNumber) ? (string)__jsonNodeChassisSerialNumber : (string)NodeChassisSerialNumber;} + {_nodeSerialNumber = If( json?.PropertyT("nodeSerialNumber"), out var __jsonNodeSerialNumber) ? (string)__jsonNodeSerialNumber : (string)NodeSerialNumber;} + {_nodeDisplayName = If( json?.PropertyT("nodeDisplayName"), out var __jsonNodeDisplayName) ? (string)__jsonNodeDisplayName : (string)NodeDisplayName;} + {_nodeFriendlySoftwareVersion = If( json?.PropertyT("nodeFriendlySoftwareVersion"), out var __jsonNodeFriendlySoftwareVersion) ? (string)__jsonNodeFriendlySoftwareVersion : (string)NodeFriendlySoftwareVersion;} + {_nodeHcsVersion = If( json?.PropertyT("nodeHcsVersion"), out var __jsonNodeHcsVersion) ? (string)__jsonNodeHcsVersion : (string)NodeHcsVersion;} + {_nodeInstanceId = If( json?.PropertyT("nodeInstanceId"), out var __jsonNodeInstanceId) ? (string)__jsonNodeInstanceId : (string)NodeInstanceId;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nodeStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._nodeStatus.ToString()) : null, "nodeStatus" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nodeChassisSerialNumber)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._nodeChassisSerialNumber.ToString()) : null, "nodeChassisSerialNumber" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nodeSerialNumber)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._nodeSerialNumber.ToString()) : null, "nodeSerialNumber" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nodeDisplayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._nodeDisplayName.ToString()) : null, "nodeDisplayName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nodeFriendlySoftwareVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._nodeFriendlySoftwareVersion.ToString()) : null, "nodeFriendlySoftwareVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nodeHcsVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._nodeHcsVersion.ToString()) : null, "nodeHcsVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nodeInstanceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._nodeInstanceId.ToString()) : null, "nodeInstanceId" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NumaNodeData.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NumaNodeData.PowerShell.cs new file mode 100644 index 000000000000..aecfaff07dd9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NumaNodeData.PowerShell.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// NUMA node data. + [System.ComponentModel.TypeConverter(typeof(NumaNodeDataTypeConverter))] + public partial class NumaNodeData + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.INumaNodeData DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NumaNodeData(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.DataBoxEdge.Models.Api20220301.INumaNodeData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NumaNodeData(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.DataBoxEdge.Models.Api20220301.INumaNodeData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NumaNodeData(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NumaNodeIndex")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).NumaNodeIndex = (int?) content.GetValueForProperty("NumaNodeIndex",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).NumaNodeIndex, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalMemoryInMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).TotalMemoryInMb = (long?) content.GetValueForProperty("TotalMemoryInMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).TotalMemoryInMb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LogicalCoreCountPerCore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).LogicalCoreCountPerCore = (int?) content.GetValueForProperty("LogicalCoreCountPerCore",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).LogicalCoreCountPerCore, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EffectiveAvailableMemoryInMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).EffectiveAvailableMemoryInMb = (long?) content.GetValueForProperty("EffectiveAvailableMemoryInMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).EffectiveAvailableMemoryInMb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FreeVCpuIndexesForHpn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).FreeVCpuIndexesForHpn = (int[]) content.GetValueForProperty("FreeVCpuIndexesForHpn",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).FreeVCpuIndexesForHpn, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("VCpuIndexesForHpn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).VCpuIndexesForHpn = (int[]) content.GetValueForProperty("VCpuIndexesForHpn",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).VCpuIndexesForHpn, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("VCpuIndexesForRoot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).VCpuIndexesForRoot = (int[]) content.GetValueForProperty("VCpuIndexesForRoot",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).VCpuIndexesForRoot, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NumaNodeData(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NumaNodeIndex")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).NumaNodeIndex = (int?) content.GetValueForProperty("NumaNodeIndex",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).NumaNodeIndex, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalMemoryInMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).TotalMemoryInMb = (long?) content.GetValueForProperty("TotalMemoryInMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).TotalMemoryInMb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LogicalCoreCountPerCore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).LogicalCoreCountPerCore = (int?) content.GetValueForProperty("LogicalCoreCountPerCore",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).LogicalCoreCountPerCore, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EffectiveAvailableMemoryInMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).EffectiveAvailableMemoryInMb = (long?) content.GetValueForProperty("EffectiveAvailableMemoryInMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).EffectiveAvailableMemoryInMb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("FreeVCpuIndexesForHpn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).FreeVCpuIndexesForHpn = (int[]) content.GetValueForProperty("FreeVCpuIndexesForHpn",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).FreeVCpuIndexesForHpn, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("VCpuIndexesForHpn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).VCpuIndexesForHpn = (int[]) content.GetValueForProperty("VCpuIndexesForHpn",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).VCpuIndexesForHpn, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("VCpuIndexesForRoot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).VCpuIndexesForRoot = (int[]) content.GetValueForProperty("VCpuIndexesForRoot",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal)this).VCpuIndexesForRoot, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// NUMA node data. + [System.ComponentModel.TypeConverter(typeof(NumaNodeDataTypeConverter))] + public partial interface INumaNodeData + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NumaNodeData.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NumaNodeData.TypeConverter.cs new file mode 100644 index 000000000000..3b29ff452137 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NumaNodeData.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NumaNodeDataTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.INumaNodeData ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeData).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NumaNodeData.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NumaNodeData.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NumaNodeData.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/databoxedge/generated/api/Models/Api20220301/NumaNodeData.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NumaNodeData.cs new file mode 100644 index 000000000000..5d33723f4d73 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NumaNodeData.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// NUMA node data. + public partial class NumaNodeData : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeData, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeDataInternal + { + + /// Backing field for property. + private long? _effectiveAvailableMemoryInMb; + + /// The effective available memory on the NUMA node in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public long? EffectiveAvailableMemoryInMb { get => this._effectiveAvailableMemoryInMb; set => this._effectiveAvailableMemoryInMb = value; } + + /// Backing field for property. + private int[] _freeVCpuIndexesForHpn; + + /// The free VCPU indices for the Hpn VMs. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int[] FreeVCpuIndexesForHpn { get => this._freeVCpuIndexesForHpn; set => this._freeVCpuIndexesForHpn = value; } + + /// Backing field for property. + private int? _logicalCoreCountPerCore; + + /// The logical cores per core count. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? LogicalCoreCountPerCore { get => this._logicalCoreCountPerCore; set => this._logicalCoreCountPerCore = value; } + + /// Backing field for property. + private int? _numaNodeIndex; + + /// The NUMA node index. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? NumaNodeIndex { get => this._numaNodeIndex; set => this._numaNodeIndex = value; } + + /// Backing field for property. + private long? _totalMemoryInMb; + + /// The total memory on the NUMA node. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public long? TotalMemoryInMb { get => this._totalMemoryInMb; set => this._totalMemoryInMb = value; } + + /// Backing field for property. + private int[] _vCpuIndexesForHpn; + + /// The VCPU indices for Hpn VMs + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int[] VCpuIndexesForHpn { get => this._vCpuIndexesForHpn; set => this._vCpuIndexesForHpn = value; } + + /// Backing field for property. + private int[] _vCpuIndexesForRoot; + + /// The VCPU indices for the root. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int[] VCpuIndexesForRoot { get => this._vCpuIndexesForRoot; set => this._vCpuIndexesForRoot = value; } + + /// Creates an new instance. + public NumaNodeData() + { + + } + } + /// NUMA node data. + public partial interface INumaNodeData : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The effective available memory on the NUMA node in MB. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The effective available memory on the NUMA node in MB.", + SerializedName = @"effectiveAvailableMemoryInMb", + PossibleTypes = new [] { typeof(long) })] + long? EffectiveAvailableMemoryInMb { get; set; } + /// The free VCPU indices for the Hpn VMs. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The free VCPU indices for the Hpn VMs.", + SerializedName = @"freeVCpuIndexesForHpn", + PossibleTypes = new [] { typeof(int) })] + int[] FreeVCpuIndexesForHpn { get; set; } + /// The logical cores per core count. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical cores per core count.", + SerializedName = @"logicalCoreCountPerCore", + PossibleTypes = new [] { typeof(int) })] + int? LogicalCoreCountPerCore { get; set; } + /// The NUMA node index. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The NUMA node index.", + SerializedName = @"numaNodeIndex", + PossibleTypes = new [] { typeof(int) })] + int? NumaNodeIndex { get; set; } + /// The total memory on the NUMA node. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total memory on the NUMA node.", + SerializedName = @"totalMemoryInMb", + PossibleTypes = new [] { typeof(long) })] + long? TotalMemoryInMb { get; set; } + /// The VCPU indices for Hpn VMs + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The VCPU indices for Hpn VMs", + SerializedName = @"vCpuIndexesForHpn", + PossibleTypes = new [] { typeof(int) })] + int[] VCpuIndexesForHpn { get; set; } + /// The VCPU indices for the root. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The VCPU indices for the root.", + SerializedName = @"vCpuIndexesForRoot", + PossibleTypes = new [] { typeof(int) })] + int[] VCpuIndexesForRoot { get; set; } + + } + /// NUMA node data. + internal partial interface INumaNodeDataInternal + + { + /// The effective available memory on the NUMA node in MB. + long? EffectiveAvailableMemoryInMb { get; set; } + /// The free VCPU indices for the Hpn VMs. + int[] FreeVCpuIndexesForHpn { get; set; } + /// The logical cores per core count. + int? LogicalCoreCountPerCore { get; set; } + /// The NUMA node index. + int? NumaNodeIndex { get; set; } + /// The total memory on the NUMA node. + long? TotalMemoryInMb { get; set; } + /// The VCPU indices for Hpn VMs + int[] VCpuIndexesForHpn { get; set; } + /// The VCPU indices for the root. + int[] VCpuIndexesForRoot { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/NumaNodeData.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/NumaNodeData.json.cs new file mode 100644 index 000000000000..36c04b784162 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/NumaNodeData.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// NUMA node data. + public partial class NumaNodeData + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeData. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeData. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INumaNodeData FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new NumaNodeData(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal NumaNodeData(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_numaNodeIndex = If( json?.PropertyT("numaNodeIndex"), out var __jsonNumaNodeIndex) ? (int?)__jsonNumaNodeIndex : NumaNodeIndex;} + {_totalMemoryInMb = If( json?.PropertyT("totalMemoryInMb"), out var __jsonTotalMemoryInMb) ? (long?)__jsonTotalMemoryInMb : TotalMemoryInMb;} + {_logicalCoreCountPerCore = If( json?.PropertyT("logicalCoreCountPerCore"), out var __jsonLogicalCoreCountPerCore) ? (int?)__jsonLogicalCoreCountPerCore : LogicalCoreCountPerCore;} + {_effectiveAvailableMemoryInMb = If( json?.PropertyT("effectiveAvailableMemoryInMb"), out var __jsonEffectiveAvailableMemoryInMb) ? (long?)__jsonEffectiveAvailableMemoryInMb : EffectiveAvailableMemoryInMb;} + {_freeVCpuIndexesForHpn = If( json?.PropertyT("freeVCpuIndexesForHpn"), out var __jsonFreeVCpuIndexesForHpn) ? If( __jsonFreeVCpuIndexesForHpn as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(int) (__u is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber __t ? (int)__t : default(int))) ))() : null : FreeVCpuIndexesForHpn;} + {_vCpuIndexesForHpn = If( json?.PropertyT("vCpuIndexesForHpn"), out var __jsonVCpuIndexesForHpn) ? If( __jsonVCpuIndexesForHpn as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(int) (__p is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber __o ? (int)__o : default(int))) ))() : null : VCpuIndexesForHpn;} + {_vCpuIndexesForRoot = If( json?.PropertyT("vCpuIndexesForRoot"), out var __jsonVCpuIndexesForRoot) ? If( __jsonVCpuIndexesForRoot as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(int) (__k is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber __j ? (int)__j : default(int))) ))() : null : VCpuIndexesForRoot;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._numaNodeIndex ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._numaNodeIndex) : null, "numaNodeIndex" ,container.Add ); + AddIf( null != this._totalMemoryInMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((long)this._totalMemoryInMb) : null, "totalMemoryInMb" ,container.Add ); + AddIf( null != this._logicalCoreCountPerCore ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._logicalCoreCountPerCore) : null, "logicalCoreCountPerCore" ,container.Add ); + AddIf( null != this._effectiveAvailableMemoryInMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((long)this._effectiveAvailableMemoryInMb) : null, "effectiveAvailableMemoryInMb" ,container.Add ); + if (null != this._freeVCpuIndexesForHpn) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._freeVCpuIndexesForHpn ) + { + AddIf((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber(__x) ,__w.Add); + } + container.Add("freeVCpuIndexesForHpn",__w); + } + if (null != this._vCpuIndexesForHpn) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __s in this._vCpuIndexesForHpn ) + { + AddIf((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber(__s) ,__r.Add); + } + container.Add("vCpuIndexesForHpn",__r); + } + if (null != this._vCpuIndexesForRoot) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __n in this._vCpuIndexesForRoot ) + { + AddIf((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber(__n) ,__m.Add); + } + container.Add("vCpuIndexesForRoot",__m); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Operation.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Operation.PowerShell.cs new file mode 100644 index 000000000000..18d470d6c86d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Operation.PowerShell.cs @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Operations. + [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] + public partial class Operation + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Operation(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.DataBoxEdge.Models.Api20220301.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Operation(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.DataBoxEdge.Models.Api20220301.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Operation(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.DataBoxEdge.Models.Api20220301.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OperationDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OperationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("IsDataAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Origin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).Origin, global::System.Convert.ToString); + } + if (content.Contains("ServiceSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ServiceSpecificationTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + } + if (content.Contains("ServiceSpecificationMetricSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricSpecificationV1TypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Operation(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.DataBoxEdge.Models.Api20220301.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OperationDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OperationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("IsDataAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Origin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).Origin, global::System.Convert.ToString); + } + if (content.Contains("ServiceSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ServiceSpecificationTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + } + if (content.Contains("ServiceSpecificationMetricSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricSpecificationV1TypeConverter.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Operations. + [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] + public partial interface IOperation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Operation.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Operation.TypeConverter.cs new file mode 100644 index 000000000000..dc6cac4dd2e5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Operation.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IOperation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Operation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Operation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Operation.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/databoxedge/generated/api/Models/Api20220301/Operation.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Operation.cs new file mode 100644 index 000000000000..2f6d283a77c8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Operation.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Operations. + public partial class Operation : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperation, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplay _display; + + /// Properties displayed for the operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OperationDisplay()); set => this._display = value; } + + /// Description of the operation to be performed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)Display).Description = value ?? null; } + + /// Operation to be performed on the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)Display).Operation = value ?? null; } + + /// Provider name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)Display).Provider = value ?? null; } + + /// The type of resource in which the operation is performed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)Display).Resource = value ?? null; } + + /// Backing field for property. + private bool? _isDataAction; + + /// Is data action. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public bool? IsDataAction { get => this._isDataAction; set => this._isDataAction = value; } + + /// Internal Acessors for Display + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OperationDisplay()); set { {_display = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OperationProperties()); set { {_property = value;} } } + + /// Internal Acessors for ServiceSpecification + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecification Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationInternal.ServiceSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationPropertiesInternal)Property).ServiceSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationPropertiesInternal)Property).ServiceSpecification = value; } + + /// Backing field for property. + private string _name; + + /// Name of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _origin; + + /// Origin of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Origin { get => this._origin; set => this._origin = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationProperties _property; + + /// Operation properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OperationProperties()); set => this._property = value; } + + /// Metric specification as defined by shoebox. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1[] ServiceSpecificationMetricSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationPropertiesInternal)Property).ServiceSpecificationMetricSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationPropertiesInternal)Property).ServiceSpecificationMetricSpecification = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public Operation() + { + + } + } + /// Operations. + public partial interface IOperation : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Description of the operation to be performed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the operation to be performed.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string DisplayDescription { get; set; } + /// Operation to be performed on the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation to be performed on the resource.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string DisplayOperation { get; set; } + /// Provider name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provider name.", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string DisplayProvider { get; set; } + /// The type of resource in which the operation is performed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of resource in which the operation is performed.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string DisplayResource { get; set; } + /// Is data action. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Is data action.", + SerializedName = @"isDataAction", + PossibleTypes = new [] { typeof(bool) })] + bool? IsDataAction { get; set; } + /// Name of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the operation.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Origin of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Origin of the operation.", + SerializedName = @"origin", + PossibleTypes = new [] { typeof(string) })] + string Origin { get; set; } + /// Metric specification as defined by shoebox. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Metric specification as defined by shoebox.", + SerializedName = @"metricSpecifications", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1[] ServiceSpecificationMetricSpecification { get; set; } + + } + /// Operations. + internal partial interface IOperationInternal + + { + /// Properties displayed for the operation. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplay Display { get; set; } + /// Description of the operation to be performed. + string DisplayDescription { get; set; } + /// Operation to be performed on the resource. + string DisplayOperation { get; set; } + /// Provider name. + string DisplayProvider { get; set; } + /// The type of resource in which the operation is performed. + string DisplayResource { get; set; } + /// Is data action. + bool? IsDataAction { get; set; } + /// Name of the operation. + string Name { get; set; } + /// Origin of the operation. + string Origin { get; set; } + /// Operation properties. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationProperties Property { get; set; } + /// Service specification. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecification ServiceSpecification { get; set; } + /// Metric specification as defined by shoebox. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1[] ServiceSpecificationMetricSpecification { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Operation.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Operation.json.cs new file mode 100644 index 000000000000..b34265eb9063 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Operation.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Operations. + public partial class Operation + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new Operation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal Operation(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.OperationDisplay.FromJson(__jsonDisplay) : Display;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OperationProperties.FromJson(__jsonProperties) : Property;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_isDataAction = If( json?.PropertyT("isDataAction"), out var __jsonIsDataAction) ? (bool?)__jsonIsDataAction : IsDataAction;} + {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)Origin;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != this._isDataAction ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonBoolean((bool)this._isDataAction) : null, "isDataAction" ,container.Add ); + AddIf( null != (((object)this._origin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._origin.ToString()) : null, "origin" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationDisplay.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationDisplay.PowerShell.cs new file mode 100644 index 000000000000..4914a0c83032 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationDisplay.PowerShell.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Operation display properties. + [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] + public partial class OperationDisplay + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationDisplay(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.DataBoxEdge.Models.Api20220301.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationDisplay(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.DataBoxEdge.Models.Api20220301.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationDisplay(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.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)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 OperationDisplay(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.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal)this).Description, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Operation display properties. + [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] + public partial interface IOperationDisplay + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationDisplay.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationDisplay.TypeConverter.cs new file mode 100644 index 000000000000..19257a654f00 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationDisplay.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationDisplayTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IOperationDisplay ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplay).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationDisplay.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationDisplay.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationDisplay.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/databoxedge/generated/api/Models/Api20220301/OperationDisplay.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationDisplay.cs new file mode 100644 index 000000000000..cea66ba15777 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationDisplay.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Operation display properties. + public partial class OperationDisplay : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplayInternal + { + + /// Backing field for property. + private string _description; + + /// Description of the operation to be performed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _operation; + + /// Operation to be performed on the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Operation { get => this._operation; set => this._operation = value; } + + /// Backing field for property. + private string _provider; + + /// Provider name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Provider { get => this._provider; set => this._provider = value; } + + /// Backing field for property. + private string _resource; + + /// The type of resource in which the operation is performed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Resource { get => this._resource; set => this._resource = value; } + + /// Creates an new instance. + public OperationDisplay() + { + + } + } + /// Operation display properties. + public partial interface IOperationDisplay : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Description of the operation to be performed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the operation to be performed.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Operation to be performed on the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation to be performed on the resource.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string Operation { get; set; } + /// Provider name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Provider name.", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string Provider { get; set; } + /// The type of resource in which the operation is performed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of resource in which the operation is performed.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string Resource { get; set; } + + } + /// Operation display properties. + internal partial interface IOperationDisplayInternal + + { + /// Description of the operation to be performed. + string Description { get; set; } + /// Operation to be performed on the resource. + string Operation { get; set; } + /// Provider name. + string Provider { get; set; } + /// The type of resource in which the operation is performed. + string Resource { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationDisplay.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationDisplay.json.cs new file mode 100644 index 000000000000..570051dbb044 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationDisplay.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Operation display properties. + public partial class OperationDisplay + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplay. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplay. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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); + } + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); + AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); + AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/OperationProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationProperties.PowerShell.cs new file mode 100644 index 000000000000..bd4141017169 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Operation properties. + [System.ComponentModel.TypeConverter(typeof(OperationPropertiesTypeConverter))] + public partial class OperationProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IOperationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationProperties(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.DataBoxEdge.Models.Api20220301.IOperationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationProperties(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.DataBoxEdge.Models.Api20220301.IOperationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServiceSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationPropertiesInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationPropertiesInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ServiceSpecificationTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceSpecificationMetricSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricSpecificationV1TypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServiceSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationPropertiesInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationPropertiesInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ServiceSpecificationTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceSpecificationMetricSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricSpecificationV1TypeConverter.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Operation properties. + [System.ComponentModel.TypeConverter(typeof(OperationPropertiesTypeConverter))] + public partial interface IOperationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationProperties.TypeConverter.cs new file mode 100644 index 000000000000..c60079b7841c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationPropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IOperationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationProperties.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/databoxedge/generated/api/Models/Api20220301/OperationProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationProperties.cs new file mode 100644 index 000000000000..6d1e5f1644e6 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationProperties.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Operation properties. + public partial class OperationProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationPropertiesInternal + { + + /// Internal Acessors for ServiceSpecification + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecification Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationPropertiesInternal.ServiceSpecification { get => (this._serviceSpecification = this._serviceSpecification ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ServiceSpecification()); set { {_serviceSpecification = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecification _serviceSpecification; + + /// Service specification. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecification ServiceSpecification { get => (this._serviceSpecification = this._serviceSpecification ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ServiceSpecification()); set => this._serviceSpecification = value; } + + /// Metric specification as defined by shoebox. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1[] ServiceSpecificationMetricSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecificationInternal)ServiceSpecification).MetricSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecificationInternal)ServiceSpecification).MetricSpecification = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public OperationProperties() + { + + } + } + /// Operation properties. + public partial interface IOperationProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Metric specification as defined by shoebox. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Metric specification as defined by shoebox.", + SerializedName = @"metricSpecifications", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1[] ServiceSpecificationMetricSpecification { get; set; } + + } + /// Operation properties. + internal partial interface IOperationPropertiesInternal + + { + /// Service specification. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecification ServiceSpecification { get; set; } + /// Metric specification as defined by shoebox. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1[] ServiceSpecificationMetricSpecification { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationProperties.json.cs new file mode 100644 index 000000000000..dc7e4ab631f0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationProperties.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Operation properties. + public partial class OperationProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new OperationProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal OperationProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_serviceSpecification = If( json?.PropertyT("serviceSpecification"), out var __jsonServiceSpecification) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ServiceSpecification.FromJson(__jsonServiceSpecification) : ServiceSpecification;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._serviceSpecification ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._serviceSpecification.ToJson(null,serializationMode) : null, "serviceSpecification" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationsList.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationsList.PowerShell.cs new file mode 100644 index 000000000000..991a2876db7a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationsList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The list of operations used for the discovery of available provider operations. + [System.ComponentModel.TypeConverter(typeof(OperationsListTypeConverter))] + public partial class OperationsList + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IOperationsList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationsList(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.DataBoxEdge.Models.Api20220301.IOperationsList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationsList(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.DataBoxEdge.Models.Api20220301.IOperationsList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationsList(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.DataBoxEdge.Models.Api20220301.IOperationsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OperationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationsListInternal)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 OperationsList(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.DataBoxEdge.Models.Api20220301.IOperationsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OperationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationsListInternal)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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The list of operations used for the discovery of available provider operations. + [System.ComponentModel.TypeConverter(typeof(OperationsListTypeConverter))] + public partial interface IOperationsList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationsList.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationsList.TypeConverter.cs new file mode 100644 index 000000000000..5717688349f8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationsList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationsListTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IOperationsList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationsList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationsList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationsList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationsList.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/databoxedge/generated/api/Models/Api20220301/OperationsList.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationsList.cs new file mode 100644 index 000000000000..166dd1ff4eed --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationsList.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The list of operations used for the discovery of available provider operations. + public partial class OperationsList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationsList, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationsListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperation[] _value; + + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperation[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public OperationsList() + { + + } + } + /// The list of operations used for the discovery of available provider operations. + public partial interface IOperationsList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Link to the next set of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperation) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperation[] Value { get; set; } + + } + /// The list of operations used for the discovery of available provider operations. + internal partial interface IOperationsListInternal + + { + /// Link to the next set of results. + string NextLink { get; set; } + /// The value. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperation[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationsList.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationsList.json.cs new file mode 100644 index 000000000000..6320cef0ca8b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OperationsList.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The list of operations used for the discovery of available provider operations. + public partial class OperationsList + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationsList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationsList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperationsList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new OperationsList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal OperationsList(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Operation.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/Order.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Order.PowerShell.cs new file mode 100644 index 000000000000..7299ff6f1606 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Order.PowerShell.cs @@ -0,0 +1,462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The order details. + [System.ComponentModel.TypeConverter(typeof(OrderTypeConverter))] + public partial class Order + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IOrder DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Order(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.DataBoxEdge.Models.Api20220301.IOrder DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Order(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.DataBoxEdge.Models.Api20220301.IOrder FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Order(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ShipmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShipmentType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType?) content.GetValueForProperty("ShipmentType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShipmentType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ContactInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformation = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetails) content.GetValueForProperty("ContactInformation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformation, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContactDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("ShippingAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddress = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddress) content.GetValueForProperty("ShippingAddress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddress, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AddressTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesCurrentStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).PropertiesCurrentStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus) content.GetValueForProperty("PropertiesCurrentStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).PropertiesCurrentStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatusTypeConverter.ConvertFrom); + } + if (content.Contains("OrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).OrderId = (string) content.GetValueForProperty("OrderId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).OrderId, global::System.Convert.ToString); + } + if (content.Contains("History")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).History = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus[]) content.GetValueForProperty("History",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).History, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("DeliveryTrackingInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).DeliveryTrackingInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[]) content.GetValueForProperty("DeliveryTrackingInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).DeliveryTrackingInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("ReturnTrackingInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ReturnTrackingInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[]) content.GetValueForProperty("ReturnTrackingInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ReturnTrackingInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("ShippingAddressLine1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressLine1 = (string) content.GetValueForProperty("ShippingAddressLine1",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressLine1, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressLine2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressLine2 = (string) content.GetValueForProperty("ShippingAddressLine2",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressLine2, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressLine3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressLine3 = (string) content.GetValueForProperty("ShippingAddressLine3",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressLine3, global::System.Convert.ToString); + } + if (content.Contains("ContactInformationContactPerson")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformationContactPerson = (string) content.GetValueForProperty("ContactInformationContactPerson",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformationContactPerson, global::System.Convert.ToString); + } + if (content.Contains("ContactInformationCompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformationCompanyName = (string) content.GetValueForProperty("ContactInformationCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformationCompanyName, global::System.Convert.ToString); + } + if (content.Contains("ContactInformationPhone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformationPhone = (string) content.GetValueForProperty("ContactInformationPhone",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformationPhone, global::System.Convert.ToString); + } + if (content.Contains("ContactInformationEmailList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformationEmailList = (string[]) content.GetValueForProperty("ContactInformationEmailList",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformationEmailList, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ShippingAddressPostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressPostalCode = (string) content.GetValueForProperty("ShippingAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressPostalCode, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressCity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressCity = (string) content.GetValueForProperty("ShippingAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressCity, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressState = (string) content.GetValueForProperty("ShippingAddressState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressState, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressCountry")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressCountry = (string) content.GetValueForProperty("ShippingAddressCountry",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressCountry, global::System.Convert.ToString); + } + if (content.Contains("CurrentStatusTrackingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).CurrentStatusTrackingInformation = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo) content.GetValueForProperty("CurrentStatusTrackingInformation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).CurrentStatusTrackingInformation, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfoTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesCurrentStatusStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).PropertiesCurrentStatusStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState) content.GetValueForProperty("PropertiesCurrentStatusStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).PropertiesCurrentStatusStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState.CreateFrom); + } + if (content.Contains("CurrentStatusUpdateDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).CurrentStatusUpdateDateTime = (global::System.DateTime?) content.GetValueForProperty("CurrentStatusUpdateDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).CurrentStatusUpdateDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CurrentStatusComment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).CurrentStatusComment = (string) content.GetValueForProperty("CurrentStatusComment",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).CurrentStatusComment, global::System.Convert.ToString); + } + if (content.Contains("CurrentStatusAdditionalOrderDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).CurrentStatusAdditionalOrderDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails) content.GetValueForProperty("CurrentStatusAdditionalOrderDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).CurrentStatusAdditionalOrderDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatusAdditionalOrderDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("TrackingInformationSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).TrackingInformationSerialNumber = (string) content.GetValueForProperty("TrackingInformationSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).TrackingInformationSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("TrackingInformationCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).TrackingInformationCarrierName = (string) content.GetValueForProperty("TrackingInformationCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).TrackingInformationCarrierName, global::System.Convert.ToString); + } + if (content.Contains("TrackingInformationTrackingId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).TrackingInformationTrackingId = (string) content.GetValueForProperty("TrackingInformationTrackingId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).TrackingInformationTrackingId, global::System.Convert.ToString); + } + if (content.Contains("TrackingInformationTrackingUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).TrackingInformationTrackingUrl = (string) content.GetValueForProperty("TrackingInformationTrackingUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).TrackingInformationTrackingUrl, 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 Order(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ShipmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShipmentType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType?) content.GetValueForProperty("ShipmentType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShipmentType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ContactInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformation = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetails) content.GetValueForProperty("ContactInformation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformation, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContactDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("ShippingAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddress = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddress) content.GetValueForProperty("ShippingAddress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddress, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AddressTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesCurrentStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).PropertiesCurrentStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus) content.GetValueForProperty("PropertiesCurrentStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).PropertiesCurrentStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatusTypeConverter.ConvertFrom); + } + if (content.Contains("OrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).OrderId = (string) content.GetValueForProperty("OrderId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).OrderId, global::System.Convert.ToString); + } + if (content.Contains("History")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).History = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus[]) content.GetValueForProperty("History",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).History, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("DeliveryTrackingInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).DeliveryTrackingInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[]) content.GetValueForProperty("DeliveryTrackingInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).DeliveryTrackingInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("ReturnTrackingInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ReturnTrackingInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[]) content.GetValueForProperty("ReturnTrackingInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ReturnTrackingInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("ShippingAddressLine1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressLine1 = (string) content.GetValueForProperty("ShippingAddressLine1",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressLine1, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressLine2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressLine2 = (string) content.GetValueForProperty("ShippingAddressLine2",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressLine2, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressLine3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressLine3 = (string) content.GetValueForProperty("ShippingAddressLine3",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressLine3, global::System.Convert.ToString); + } + if (content.Contains("ContactInformationContactPerson")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformationContactPerson = (string) content.GetValueForProperty("ContactInformationContactPerson",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformationContactPerson, global::System.Convert.ToString); + } + if (content.Contains("ContactInformationCompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformationCompanyName = (string) content.GetValueForProperty("ContactInformationCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformationCompanyName, global::System.Convert.ToString); + } + if (content.Contains("ContactInformationPhone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformationPhone = (string) content.GetValueForProperty("ContactInformationPhone",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformationPhone, global::System.Convert.ToString); + } + if (content.Contains("ContactInformationEmailList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformationEmailList = (string[]) content.GetValueForProperty("ContactInformationEmailList",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ContactInformationEmailList, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ShippingAddressPostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressPostalCode = (string) content.GetValueForProperty("ShippingAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressPostalCode, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressCity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressCity = (string) content.GetValueForProperty("ShippingAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressCity, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressState = (string) content.GetValueForProperty("ShippingAddressState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressState, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressCountry")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressCountry = (string) content.GetValueForProperty("ShippingAddressCountry",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).ShippingAddressCountry, global::System.Convert.ToString); + } + if (content.Contains("CurrentStatusTrackingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).CurrentStatusTrackingInformation = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo) content.GetValueForProperty("CurrentStatusTrackingInformation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).CurrentStatusTrackingInformation, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfoTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesCurrentStatusStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).PropertiesCurrentStatusStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState) content.GetValueForProperty("PropertiesCurrentStatusStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).PropertiesCurrentStatusStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState.CreateFrom); + } + if (content.Contains("CurrentStatusUpdateDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).CurrentStatusUpdateDateTime = (global::System.DateTime?) content.GetValueForProperty("CurrentStatusUpdateDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).CurrentStatusUpdateDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CurrentStatusComment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).CurrentStatusComment = (string) content.GetValueForProperty("CurrentStatusComment",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).CurrentStatusComment, global::System.Convert.ToString); + } + if (content.Contains("CurrentStatusAdditionalOrderDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).CurrentStatusAdditionalOrderDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails) content.GetValueForProperty("CurrentStatusAdditionalOrderDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).CurrentStatusAdditionalOrderDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatusAdditionalOrderDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("TrackingInformationSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).TrackingInformationSerialNumber = (string) content.GetValueForProperty("TrackingInformationSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).TrackingInformationSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("TrackingInformationCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).TrackingInformationCarrierName = (string) content.GetValueForProperty("TrackingInformationCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).TrackingInformationCarrierName, global::System.Convert.ToString); + } + if (content.Contains("TrackingInformationTrackingId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).TrackingInformationTrackingId = (string) content.GetValueForProperty("TrackingInformationTrackingId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).TrackingInformationTrackingId, global::System.Convert.ToString); + } + if (content.Contains("TrackingInformationTrackingUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).TrackingInformationTrackingUrl = (string) content.GetValueForProperty("TrackingInformationTrackingUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal)this).TrackingInformationTrackingUrl, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The order details. + [System.ComponentModel.TypeConverter(typeof(OrderTypeConverter))] + public partial interface IOrder + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Order.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Order.TypeConverter.cs new file mode 100644 index 000000000000..c7c2fe177b53 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Order.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OrderTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IOrder ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Order.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Order.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Order.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/databoxedge/generated/api/Models/Api20220301/Order.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Order.cs new file mode 100644 index 000000000000..2db8ec748124 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Order.cs @@ -0,0 +1,615 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The order details. + public partial class Order : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// The name of the company. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ContactInformationCompanyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ContactInformationCompanyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ContactInformationCompanyName = value ?? null; } + + /// The contact person name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ContactInformationContactPerson { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ContactInformationContactPerson; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ContactInformationContactPerson = value ?? null; } + + /// The email list. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string[] ContactInformationEmailList { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ContactInformationEmailList; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ContactInformationEmailList = value ?? null /* arrayOf */; } + + /// The phone number. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ContactInformationPhone { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ContactInformationPhone; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ContactInformationPhone = value ?? null; } + + /// + /// Dictionary to hold generic information which is not stored + /// by the already existing properties + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails CurrentStatusAdditionalOrderDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).CurrentStatusAdditionalOrderDetail; } + + /// Comments related to this status change. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CurrentStatusComment { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).CurrentStatusComment; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).CurrentStatusComment = value ?? null; } + + /// Time of status update. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? CurrentStatusUpdateDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).CurrentStatusUpdateDateTime; } + + /// + /// Tracking information for the package delivered to the customer whether it has an original or a replacement device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[] DeliveryTrackingInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).DeliveryTrackingInfo; } + + /// List of status changes in the order. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus[] History { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).OrderHistory; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// Backing field for property. + private string _kind; + + /// It specify the order api version. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Kind { get => this._kind; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for ContactInformation + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetails Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal.ContactInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ContactInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ContactInformation = value; } + + /// Internal Acessors for CurrentStatusAdditionalOrderDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal.CurrentStatusAdditionalOrderDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).CurrentStatusAdditionalOrderDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).CurrentStatusAdditionalOrderDetail = value; } + + /// Internal Acessors for CurrentStatusTrackingInformation + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal.CurrentStatusTrackingInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).CurrentStatusTrackingInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).CurrentStatusTrackingInformation = value; } + + /// Internal Acessors for CurrentStatusUpdateDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal.CurrentStatusUpdateDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).CurrentStatusUpdateDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).CurrentStatusUpdateDateTime = value; } + + /// Internal Acessors for DeliveryTrackingInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal.DeliveryTrackingInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).DeliveryTrackingInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).DeliveryTrackingInfo = value; } + + /// Internal Acessors for History + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal.History { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).OrderHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).OrderHistory = value; } + + /// Internal Acessors for Kind + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal.Kind { get => this._kind; set { {_kind = value;} } } + + /// Internal Acessors for OrderId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal.OrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).OrderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).OrderId = value; } + + /// Internal Acessors for PropertiesCurrentStatus + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal.PropertiesCurrentStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).CurrentStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).CurrentStatus = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderProperties()); set { {_property = value;} } } + + /// Internal Acessors for ReturnTrackingInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal.ReturnTrackingInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ReturnTrackingInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ReturnTrackingInfo = value; } + + /// Internal Acessors for SerialNumber + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal.SerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).SerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).SerialNumber = value; } + + /// Internal Acessors for ShippingAddress + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddress Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal.ShippingAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ShippingAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ShippingAddress = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// It specify the order resource id. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string OrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).OrderId; } + + /// Status of the order as per the allowed status types. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState? PropertiesCurrentStatusStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).CurrentStatusStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).CurrentStatusStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderProperties _property; + + /// The order properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderProperties()); set => this._property = value; } + + /// + /// Tracking information for the package returned from the customer whether it has an original or a replacement device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[] ReturnTrackingInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ReturnTrackingInfo; } + + /// Serial number of the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).SerialNumber; } + + /// ShipmentType of the order + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType? ShipmentType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ShipmentType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ShipmentType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType)""); } + + /// The city name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ShippingAddressCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ShippingAddressCity; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ShippingAddressCity = value ?? null; } + + /// The country name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ShippingAddressCountry { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ShippingAddressCountry; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ShippingAddressCountry = value ?? null; } + + /// The address line1. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ShippingAddressLine1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ShippingAddressLine1; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ShippingAddressLine1 = value ?? null; } + + /// The address line2. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ShippingAddressLine2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ShippingAddressLine2; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ShippingAddressLine2 = value ?? null; } + + /// The address line3. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ShippingAddressLine3 { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ShippingAddressLine3; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ShippingAddressLine3 = value ?? null; } + + /// The postal code. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ShippingAddressPostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ShippingAddressPostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ShippingAddressPostalCode = value ?? null; } + + /// The state name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ShippingAddressState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ShippingAddressState; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).ShippingAddressState = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of Order + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// Name of the carrier used in the delivery. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string TrackingInformationCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).TrackingInformationCarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).TrackingInformationCarrierName = value ?? null; } + + /// Serial number of the device being tracked. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string TrackingInformationSerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).TrackingInformationSerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).TrackingInformationSerialNumber = value ?? null; } + + /// Tracking ID of the shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string TrackingInformationTrackingId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).TrackingInformationTrackingId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).TrackingInformationTrackingId = value ?? null; } + + /// Tracking URL of the shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string TrackingInformationTrackingUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).TrackingInformationTrackingUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)Property).TrackingInformationTrackingUrl = value ?? null; } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Creates an new instance. + public Order() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// The order details. + public partial interface IOrder : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// The name of the company. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the company.", + SerializedName = @"companyName", + PossibleTypes = new [] { typeof(string) })] + string ContactInformationCompanyName { get; set; } + /// The contact person name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The contact person name.", + SerializedName = @"contactPerson", + PossibleTypes = new [] { typeof(string) })] + string ContactInformationContactPerson { get; set; } + /// The email list. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The email list.", + SerializedName = @"emailList", + PossibleTypes = new [] { typeof(string) })] + string[] ContactInformationEmailList { get; set; } + /// The phone number. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The phone number.", + SerializedName = @"phone", + PossibleTypes = new [] { typeof(string) })] + string ContactInformationPhone { get; set; } + /// + /// Dictionary to hold generic information which is not stored + /// by the already existing properties + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Dictionary to hold generic information which is not stored + by the already existing properties", + SerializedName = @"additionalOrderDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails CurrentStatusAdditionalOrderDetail { get; } + /// Comments related to this status change. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Comments related to this status change.", + SerializedName = @"comments", + PossibleTypes = new [] { typeof(string) })] + string CurrentStatusComment { get; set; } + /// Time of status update. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Time of status update.", + SerializedName = @"updateDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CurrentStatusUpdateDateTime { get; } + /// + /// Tracking information for the package delivered to the customer whether it has an original or a replacement device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Tracking information for the package delivered to the customer whether it has an original or a replacement device.", + SerializedName = @"deliveryTrackingInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[] DeliveryTrackingInfo { get; } + /// List of status changes in the order. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of status changes in the order.", + SerializedName = @"orderHistory", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus[] History { get; } + /// It specify the order api version. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"It specify the order api version.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + string Kind { get; } + /// It specify the order resource id. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"It specify the order resource id.", + SerializedName = @"orderId", + PossibleTypes = new [] { typeof(string) })] + string OrderId { get; } + /// Status of the order as per the allowed status types. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of the order as per the allowed status types.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState? PropertiesCurrentStatusStatus { get; set; } + /// + /// Tracking information for the package returned from the customer whether it has an original or a replacement device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Tracking information for the package returned from the customer whether it has an original or a replacement device.", + SerializedName = @"returnTrackingInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[] ReturnTrackingInfo { get; } + /// Serial number of the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Serial number of the device.", + SerializedName = @"serialNumber", + PossibleTypes = new [] { typeof(string) })] + string SerialNumber { get; } + /// ShipmentType of the order + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ShipmentType of the order", + SerializedName = @"shipmentType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType? ShipmentType { get; set; } + /// The city name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The city name.", + SerializedName = @"city", + PossibleTypes = new [] { typeof(string) })] + string ShippingAddressCity { get; set; } + /// The country name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The country name.", + SerializedName = @"country", + PossibleTypes = new [] { typeof(string) })] + string ShippingAddressCountry { get; set; } + /// The address line1. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The address line1.", + SerializedName = @"addressLine1", + PossibleTypes = new [] { typeof(string) })] + string ShippingAddressLine1 { get; set; } + /// The address line2. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The address line2.", + SerializedName = @"addressLine2", + PossibleTypes = new [] { typeof(string) })] + string ShippingAddressLine2 { get; set; } + /// The address line3. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The address line3.", + SerializedName = @"addressLine3", + PossibleTypes = new [] { typeof(string) })] + string ShippingAddressLine3 { get; set; } + /// The postal code. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The postal code.", + SerializedName = @"postalCode", + PossibleTypes = new [] { typeof(string) })] + string ShippingAddressPostalCode { get; set; } + /// The state name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The state name.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(string) })] + string ShippingAddressState { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Name of the carrier used in the delivery. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the carrier used in the delivery.", + SerializedName = @"carrierName", + PossibleTypes = new [] { typeof(string) })] + string TrackingInformationCarrierName { get; set; } + /// Serial number of the device being tracked. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Serial number of the device being tracked.", + SerializedName = @"serialNumber", + PossibleTypes = new [] { typeof(string) })] + string TrackingInformationSerialNumber { get; set; } + /// Tracking ID of the shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tracking ID of the shipment.", + SerializedName = @"trackingId", + PossibleTypes = new [] { typeof(string) })] + string TrackingInformationTrackingId { get; set; } + /// Tracking URL of the shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tracking URL of the shipment.", + SerializedName = @"trackingUrl", + PossibleTypes = new [] { typeof(string) })] + string TrackingInformationTrackingUrl { get; set; } + + } + /// The order details. + internal partial interface IOrderInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// The contact details. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetails ContactInformation { get; set; } + /// The name of the company. + string ContactInformationCompanyName { get; set; } + /// The contact person name. + string ContactInformationContactPerson { get; set; } + /// The email list. + string[] ContactInformationEmailList { get; set; } + /// The phone number. + string ContactInformationPhone { get; set; } + /// + /// Dictionary to hold generic information which is not stored + /// by the already existing properties + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails CurrentStatusAdditionalOrderDetail { get; set; } + /// Comments related to this status change. + string CurrentStatusComment { get; set; } + /// Tracking information related to the state in the ordering flow + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo CurrentStatusTrackingInformation { get; set; } + /// Time of status update. + global::System.DateTime? CurrentStatusUpdateDateTime { get; set; } + /// + /// Tracking information for the package delivered to the customer whether it has an original or a replacement device. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[] DeliveryTrackingInfo { get; set; } + /// List of status changes in the order. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus[] History { get; set; } + /// It specify the order api version. + string Kind { get; set; } + /// It specify the order resource id. + string OrderId { get; set; } + /// Current status of the order. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus PropertiesCurrentStatus { get; set; } + /// Status of the order as per the allowed status types. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState? PropertiesCurrentStatusStatus { get; set; } + /// The order properties. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderProperties Property { get; set; } + /// + /// Tracking information for the package returned from the customer whether it has an original or a replacement device. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[] ReturnTrackingInfo { get; set; } + /// Serial number of the device. + string SerialNumber { get; set; } + /// ShipmentType of the order + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType? ShipmentType { get; set; } + /// The shipping address. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddress ShippingAddress { get; set; } + /// The city name. + string ShippingAddressCity { get; set; } + /// The country name. + string ShippingAddressCountry { get; set; } + /// The address line1. + string ShippingAddressLine1 { get; set; } + /// The address line2. + string ShippingAddressLine2 { get; set; } + /// The address line3. + string ShippingAddressLine3 { get; set; } + /// The postal code. + string ShippingAddressPostalCode { get; set; } + /// The state name. + string ShippingAddressState { get; set; } + /// Metadata pertaining to creation and last modification of Order + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Name of the carrier used in the delivery. + string TrackingInformationCarrierName { get; set; } + /// Serial number of the device being tracked. + string TrackingInformationSerialNumber { get; set; } + /// Tracking ID of the shipment. + string TrackingInformationTrackingId { get; set; } + /// Tracking URL of the shipment. + string TrackingInformationTrackingUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Order.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Order.json.cs new file mode 100644 index 000000000000..20333287cc09 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Order.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The order details. + public partial class Order + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new Order(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal Order(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderProperties.FromJson(__jsonProperties) : Property;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderList.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderList.PowerShell.cs new file mode 100644 index 000000000000..946884ba98fe --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// List of order entities. + [System.ComponentModel.TypeConverter(typeof(OrderListTypeConverter))] + public partial class OrderList + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IOrderList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OrderList(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.DataBoxEdge.Models.Api20220301.IOrderList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OrderList(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.DataBoxEdge.Models.Api20220301.IOrderList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OrderList(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.DataBoxEdge.Models.Api20220301.IOrderListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderListInternal)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 OrderList(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.DataBoxEdge.Models.Api20220301.IOrderListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderListInternal)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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// List of order entities. + [System.ComponentModel.TypeConverter(typeof(OrderListTypeConverter))] + public partial interface IOrderList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderList.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderList.TypeConverter.cs new file mode 100644 index 000000000000..d024ff619aca --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OrderListTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IOrderList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OrderList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OrderList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OrderList.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/databoxedge/generated/api/Models/Api20220301/OrderList.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderList.cs new file mode 100644 index 000000000000..2bc1105e0ea1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderList.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// List of order entities. + public partial class OrderList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderList, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderListInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder[] _value; + + /// The list of orders. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder[] Value { get => this._value; } + + /// Creates an new instance. + public OrderList() + { + + } + } + /// List of order entities. + public partial interface IOrderList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Link to the next set of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of orders. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of orders.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder[] Value { get; } + + } + /// List of order entities. + internal partial interface IOrderListInternal + + { + /// Link to the next set of results. + string NextLink { get; set; } + /// The list of orders. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderList.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderList.json.cs new file mode 100644 index 000000000000..39843ae90bd5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderList.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// List of order entities. + public partial class OrderList + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new OrderList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal OrderList(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IOrder) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Order.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/OrderProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderProperties.PowerShell.cs new file mode 100644 index 000000000000..921507fc0501 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderProperties.PowerShell.cs @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Order properties. + [System.ComponentModel.TypeConverter(typeof(OrderPropertiesTypeConverter))] + public partial class OrderProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IOrderProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OrderProperties(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.DataBoxEdge.Models.Api20220301.IOrderProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OrderProperties(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.DataBoxEdge.Models.Api20220301.IOrderProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OrderProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ContactInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformation = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetails) content.GetValueForProperty("ContactInformation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformation, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContactDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("ShippingAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddress = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddress) content.GetValueForProperty("ShippingAddress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddress, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AddressTypeConverter.ConvertFrom); + } + if (content.Contains("CurrentStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus) content.GetValueForProperty("CurrentStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatusTypeConverter.ConvertFrom); + } + if (content.Contains("OrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).OrderId = (string) content.GetValueForProperty("OrderId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).OrderId, global::System.Convert.ToString); + } + if (content.Contains("OrderHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).OrderHistory = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus[]) content.GetValueForProperty("OrderHistory",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).OrderHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("DeliveryTrackingInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).DeliveryTrackingInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[]) content.GetValueForProperty("DeliveryTrackingInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).DeliveryTrackingInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("ReturnTrackingInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ReturnTrackingInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[]) content.GetValueForProperty("ReturnTrackingInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ReturnTrackingInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("ShipmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShipmentType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType?) content.GetValueForProperty("ShipmentType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShipmentType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType.CreateFrom); + } + if (content.Contains("ShippingAddressLine1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressLine1 = (string) content.GetValueForProperty("ShippingAddressLine1",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressLine1, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressLine2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressLine2 = (string) content.GetValueForProperty("ShippingAddressLine2",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressLine2, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressLine3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressLine3 = (string) content.GetValueForProperty("ShippingAddressLine3",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressLine3, global::System.Convert.ToString); + } + if (content.Contains("ContactInformationContactPerson")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformationContactPerson = (string) content.GetValueForProperty("ContactInformationContactPerson",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformationContactPerson, global::System.Convert.ToString); + } + if (content.Contains("ContactInformationCompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformationCompanyName = (string) content.GetValueForProperty("ContactInformationCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformationCompanyName, global::System.Convert.ToString); + } + if (content.Contains("ContactInformationPhone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformationPhone = (string) content.GetValueForProperty("ContactInformationPhone",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformationPhone, global::System.Convert.ToString); + } + if (content.Contains("ContactInformationEmailList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformationEmailList = (string[]) content.GetValueForProperty("ContactInformationEmailList",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformationEmailList, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ShippingAddressPostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressPostalCode = (string) content.GetValueForProperty("ShippingAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressPostalCode, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressCity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressCity = (string) content.GetValueForProperty("ShippingAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressCity, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressState = (string) content.GetValueForProperty("ShippingAddressState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressState, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressCountry")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressCountry = (string) content.GetValueForProperty("ShippingAddressCountry",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressCountry, global::System.Convert.ToString); + } + if (content.Contains("CurrentStatusTrackingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusTrackingInformation = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo) content.GetValueForProperty("CurrentStatusTrackingInformation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusTrackingInformation, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfoTypeConverter.ConvertFrom); + } + if (content.Contains("CurrentStatusStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState) content.GetValueForProperty("CurrentStatusStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState.CreateFrom); + } + if (content.Contains("CurrentStatusUpdateDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusUpdateDateTime = (global::System.DateTime?) content.GetValueForProperty("CurrentStatusUpdateDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusUpdateDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CurrentStatusComment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusComment = (string) content.GetValueForProperty("CurrentStatusComment",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusComment, global::System.Convert.ToString); + } + if (content.Contains("CurrentStatusAdditionalOrderDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusAdditionalOrderDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails) content.GetValueForProperty("CurrentStatusAdditionalOrderDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusAdditionalOrderDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatusAdditionalOrderDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("TrackingInformationSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).TrackingInformationSerialNumber = (string) content.GetValueForProperty("TrackingInformationSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).TrackingInformationSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("TrackingInformationCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).TrackingInformationCarrierName = (string) content.GetValueForProperty("TrackingInformationCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).TrackingInformationCarrierName, global::System.Convert.ToString); + } + if (content.Contains("TrackingInformationTrackingId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).TrackingInformationTrackingId = (string) content.GetValueForProperty("TrackingInformationTrackingId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).TrackingInformationTrackingId, global::System.Convert.ToString); + } + if (content.Contains("TrackingInformationTrackingUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).TrackingInformationTrackingUrl = (string) content.GetValueForProperty("TrackingInformationTrackingUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).TrackingInformationTrackingUrl, 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 OrderProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ContactInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformation = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetails) content.GetValueForProperty("ContactInformation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformation, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContactDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("ShippingAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddress = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddress) content.GetValueForProperty("ShippingAddress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddress, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AddressTypeConverter.ConvertFrom); + } + if (content.Contains("CurrentStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus) content.GetValueForProperty("CurrentStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatusTypeConverter.ConvertFrom); + } + if (content.Contains("OrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).OrderId = (string) content.GetValueForProperty("OrderId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).OrderId, global::System.Convert.ToString); + } + if (content.Contains("OrderHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).OrderHistory = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus[]) content.GetValueForProperty("OrderHistory",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).OrderHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("DeliveryTrackingInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).DeliveryTrackingInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[]) content.GetValueForProperty("DeliveryTrackingInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).DeliveryTrackingInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("ReturnTrackingInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ReturnTrackingInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[]) content.GetValueForProperty("ReturnTrackingInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ReturnTrackingInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("ShipmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShipmentType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType?) content.GetValueForProperty("ShipmentType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShipmentType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType.CreateFrom); + } + if (content.Contains("ShippingAddressLine1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressLine1 = (string) content.GetValueForProperty("ShippingAddressLine1",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressLine1, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressLine2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressLine2 = (string) content.GetValueForProperty("ShippingAddressLine2",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressLine2, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressLine3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressLine3 = (string) content.GetValueForProperty("ShippingAddressLine3",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressLine3, global::System.Convert.ToString); + } + if (content.Contains("ContactInformationContactPerson")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformationContactPerson = (string) content.GetValueForProperty("ContactInformationContactPerson",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformationContactPerson, global::System.Convert.ToString); + } + if (content.Contains("ContactInformationCompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformationCompanyName = (string) content.GetValueForProperty("ContactInformationCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformationCompanyName, global::System.Convert.ToString); + } + if (content.Contains("ContactInformationPhone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformationPhone = (string) content.GetValueForProperty("ContactInformationPhone",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformationPhone, global::System.Convert.ToString); + } + if (content.Contains("ContactInformationEmailList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformationEmailList = (string[]) content.GetValueForProperty("ContactInformationEmailList",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ContactInformationEmailList, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ShippingAddressPostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressPostalCode = (string) content.GetValueForProperty("ShippingAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressPostalCode, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressCity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressCity = (string) content.GetValueForProperty("ShippingAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressCity, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressState = (string) content.GetValueForProperty("ShippingAddressState",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressState, global::System.Convert.ToString); + } + if (content.Contains("ShippingAddressCountry")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressCountry = (string) content.GetValueForProperty("ShippingAddressCountry",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).ShippingAddressCountry, global::System.Convert.ToString); + } + if (content.Contains("CurrentStatusTrackingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusTrackingInformation = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo) content.GetValueForProperty("CurrentStatusTrackingInformation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusTrackingInformation, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfoTypeConverter.ConvertFrom); + } + if (content.Contains("CurrentStatusStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState) content.GetValueForProperty("CurrentStatusStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState.CreateFrom); + } + if (content.Contains("CurrentStatusUpdateDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusUpdateDateTime = (global::System.DateTime?) content.GetValueForProperty("CurrentStatusUpdateDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusUpdateDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CurrentStatusComment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusComment = (string) content.GetValueForProperty("CurrentStatusComment",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusComment, global::System.Convert.ToString); + } + if (content.Contains("CurrentStatusAdditionalOrderDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusAdditionalOrderDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails) content.GetValueForProperty("CurrentStatusAdditionalOrderDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).CurrentStatusAdditionalOrderDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatusAdditionalOrderDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("TrackingInformationSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).TrackingInformationSerialNumber = (string) content.GetValueForProperty("TrackingInformationSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).TrackingInformationSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("TrackingInformationCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).TrackingInformationCarrierName = (string) content.GetValueForProperty("TrackingInformationCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).TrackingInformationCarrierName, global::System.Convert.ToString); + } + if (content.Contains("TrackingInformationTrackingId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).TrackingInformationTrackingId = (string) content.GetValueForProperty("TrackingInformationTrackingId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).TrackingInformationTrackingId, global::System.Convert.ToString); + } + if (content.Contains("TrackingInformationTrackingUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).TrackingInformationTrackingUrl = (string) content.GetValueForProperty("TrackingInformationTrackingUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal)this).TrackingInformationTrackingUrl, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Order properties. + [System.ComponentModel.TypeConverter(typeof(OrderPropertiesTypeConverter))] + public partial interface IOrderProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderProperties.TypeConverter.cs new file mode 100644 index 000000000000..06ab9e8b6154 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OrderPropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IOrderProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OrderProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OrderProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OrderProperties.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/databoxedge/generated/api/Models/Api20220301/OrderProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderProperties.cs new file mode 100644 index 000000000000..e44d329d6343 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderProperties.cs @@ -0,0 +1,486 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Order properties. + public partial class OrderProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetails _contactInformation; + + /// The contact details. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetails ContactInformation { get => (this._contactInformation = this._contactInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContactDetails()); set => this._contactInformation = value; } + + /// The name of the company. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ContactInformationCompanyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)ContactInformation).CompanyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)ContactInformation).CompanyName = value ; } + + /// The contact person name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ContactInformationContactPerson { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)ContactInformation).ContactPerson; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)ContactInformation).ContactPerson = value ; } + + /// The email list. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string[] ContactInformationEmailList { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)ContactInformation).EmailList; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)ContactInformation).EmailList = value ; } + + /// The phone number. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ContactInformationPhone { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)ContactInformation).Phone; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetailsInternal)ContactInformation).Phone = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus _currentStatus; + + /// Current status of the order. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus CurrentStatus { get => (this._currentStatus = this._currentStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatus()); } + + /// + /// Dictionary to hold generic information which is not stored + /// by the already existing properties + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails CurrentStatusAdditionalOrderDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).AdditionalOrderDetail; } + + /// Comments related to this status change. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CurrentStatusComment { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).Comment; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).Comment = value ?? null; } + + /// Status of the order as per the allowed status types. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState? CurrentStatusStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState)""); } + + /// Time of status update. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? CurrentStatusUpdateDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).UpdateDateTime; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[] _deliveryTrackingInfo; + + /// + /// Tracking information for the package delivered to the customer whether it has an original or a replacement device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[] DeliveryTrackingInfo { get => this._deliveryTrackingInfo; } + + /// Internal Acessors for ContactInformation + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetails Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal.ContactInformation { get => (this._contactInformation = this._contactInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContactDetails()); set { {_contactInformation = value;} } } + + /// Internal Acessors for CurrentStatus + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal.CurrentStatus { get => (this._currentStatus = this._currentStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatus()); set { {_currentStatus = value;} } } + + /// Internal Acessors for CurrentStatusAdditionalOrderDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal.CurrentStatusAdditionalOrderDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).AdditionalOrderDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).AdditionalOrderDetail = value; } + + /// Internal Acessors for CurrentStatusTrackingInformation + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal.CurrentStatusTrackingInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).TrackingInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).TrackingInformation = value; } + + /// Internal Acessors for CurrentStatusUpdateDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal.CurrentStatusUpdateDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).UpdateDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).UpdateDateTime = value; } + + /// Internal Acessors for DeliveryTrackingInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal.DeliveryTrackingInfo { get => this._deliveryTrackingInfo; set { {_deliveryTrackingInfo = value;} } } + + /// Internal Acessors for OrderHistory + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal.OrderHistory { get => this._orderHistory; set { {_orderHistory = value;} } } + + /// Internal Acessors for OrderId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal.OrderId { get => this._orderId; set { {_orderId = value;} } } + + /// Internal Acessors for ReturnTrackingInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal.ReturnTrackingInfo { get => this._returnTrackingInfo; set { {_returnTrackingInfo = value;} } } + + /// Internal Acessors for SerialNumber + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal.SerialNumber { get => this._serialNumber; set { {_serialNumber = value;} } } + + /// Internal Acessors for ShippingAddress + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddress Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderPropertiesInternal.ShippingAddress { get => (this._shippingAddress = this._shippingAddress ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Address()); set { {_shippingAddress = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus[] _orderHistory; + + /// List of status changes in the order. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus[] OrderHistory { get => this._orderHistory; } + + /// Backing field for property. + private string _orderId; + + /// It specify the order resource id. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string OrderId { get => this._orderId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[] _returnTrackingInfo; + + /// + /// Tracking information for the package returned from the customer whether it has an original or a replacement device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[] ReturnTrackingInfo { get => this._returnTrackingInfo; } + + /// Backing field for property. + private string _serialNumber; + + /// Serial number of the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string SerialNumber { get => this._serialNumber; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType? _shipmentType; + + /// ShipmentType of the order + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType? ShipmentType { get => this._shipmentType; set => this._shipmentType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddress _shippingAddress; + + /// The shipping address. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddress ShippingAddress { get => (this._shippingAddress = this._shippingAddress ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Address()); set => this._shippingAddress = value; } + + /// The city name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ShippingAddressCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)ShippingAddress).City; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)ShippingAddress).City = value ?? null; } + + /// The country name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ShippingAddressCountry { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)ShippingAddress).Country; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)ShippingAddress).Country = value ?? null; } + + /// The address line1. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ShippingAddressLine1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)ShippingAddress).Line1; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)ShippingAddress).Line1 = value ?? null; } + + /// The address line2. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ShippingAddressLine2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)ShippingAddress).Line2; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)ShippingAddress).Line2 = value ?? null; } + + /// The address line3. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ShippingAddressLine3 { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)ShippingAddress).Line3; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)ShippingAddress).Line3 = value ?? null; } + + /// The postal code. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ShippingAddressPostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)ShippingAddress).PostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)ShippingAddress).PostalCode = value ?? null; } + + /// The state name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ShippingAddressState { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)ShippingAddress).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddressInternal)ShippingAddress).State = value ?? null; } + + /// Name of the carrier used in the delivery. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string TrackingInformationCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).TrackingInformationCarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).TrackingInformationCarrierName = value ?? null; } + + /// Serial number of the device being tracked. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string TrackingInformationSerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).TrackingInformationSerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).TrackingInformationSerialNumber = value ?? null; } + + /// Tracking ID of the shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string TrackingInformationTrackingId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).TrackingInformationTrackingId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).TrackingInformationTrackingId = value ?? null; } + + /// Tracking URL of the shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string TrackingInformationTrackingUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).TrackingInformationTrackingUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)CurrentStatus).TrackingInformationTrackingUrl = value ?? null; } + + /// Creates an new instance. + public OrderProperties() + { + + } + } + /// Order properties. + public partial interface IOrderProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The name of the company. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the company.", + SerializedName = @"companyName", + PossibleTypes = new [] { typeof(string) })] + string ContactInformationCompanyName { get; set; } + /// The contact person name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The contact person name.", + SerializedName = @"contactPerson", + PossibleTypes = new [] { typeof(string) })] + string ContactInformationContactPerson { get; set; } + /// The email list. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The email list.", + SerializedName = @"emailList", + PossibleTypes = new [] { typeof(string) })] + string[] ContactInformationEmailList { get; set; } + /// The phone number. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The phone number.", + SerializedName = @"phone", + PossibleTypes = new [] { typeof(string) })] + string ContactInformationPhone { get; set; } + /// + /// Dictionary to hold generic information which is not stored + /// by the already existing properties + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Dictionary to hold generic information which is not stored + by the already existing properties", + SerializedName = @"additionalOrderDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails CurrentStatusAdditionalOrderDetail { get; } + /// Comments related to this status change. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Comments related to this status change.", + SerializedName = @"comments", + PossibleTypes = new [] { typeof(string) })] + string CurrentStatusComment { get; set; } + /// Status of the order as per the allowed status types. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of the order as per the allowed status types.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState? CurrentStatusStatus { get; set; } + /// Time of status update. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Time of status update.", + SerializedName = @"updateDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CurrentStatusUpdateDateTime { get; } + /// + /// Tracking information for the package delivered to the customer whether it has an original or a replacement device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Tracking information for the package delivered to the customer whether it has an original or a replacement device.", + SerializedName = @"deliveryTrackingInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[] DeliveryTrackingInfo { get; } + /// List of status changes in the order. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of status changes in the order.", + SerializedName = @"orderHistory", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus[] OrderHistory { get; } + /// It specify the order resource id. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"It specify the order resource id.", + SerializedName = @"orderId", + PossibleTypes = new [] { typeof(string) })] + string OrderId { get; } + /// + /// Tracking information for the package returned from the customer whether it has an original or a replacement device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Tracking information for the package returned from the customer whether it has an original or a replacement device.", + SerializedName = @"returnTrackingInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[] ReturnTrackingInfo { get; } + /// Serial number of the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Serial number of the device.", + SerializedName = @"serialNumber", + PossibleTypes = new [] { typeof(string) })] + string SerialNumber { get; } + /// ShipmentType of the order + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ShipmentType of the order", + SerializedName = @"shipmentType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType? ShipmentType { get; set; } + /// The city name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The city name.", + SerializedName = @"city", + PossibleTypes = new [] { typeof(string) })] + string ShippingAddressCity { get; set; } + /// The country name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The country name.", + SerializedName = @"country", + PossibleTypes = new [] { typeof(string) })] + string ShippingAddressCountry { get; set; } + /// The address line1. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The address line1.", + SerializedName = @"addressLine1", + PossibleTypes = new [] { typeof(string) })] + string ShippingAddressLine1 { get; set; } + /// The address line2. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The address line2.", + SerializedName = @"addressLine2", + PossibleTypes = new [] { typeof(string) })] + string ShippingAddressLine2 { get; set; } + /// The address line3. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The address line3.", + SerializedName = @"addressLine3", + PossibleTypes = new [] { typeof(string) })] + string ShippingAddressLine3 { get; set; } + /// The postal code. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The postal code.", + SerializedName = @"postalCode", + PossibleTypes = new [] { typeof(string) })] + string ShippingAddressPostalCode { get; set; } + /// The state name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The state name.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(string) })] + string ShippingAddressState { get; set; } + /// Name of the carrier used in the delivery. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the carrier used in the delivery.", + SerializedName = @"carrierName", + PossibleTypes = new [] { typeof(string) })] + string TrackingInformationCarrierName { get; set; } + /// Serial number of the device being tracked. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Serial number of the device being tracked.", + SerializedName = @"serialNumber", + PossibleTypes = new [] { typeof(string) })] + string TrackingInformationSerialNumber { get; set; } + /// Tracking ID of the shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tracking ID of the shipment.", + SerializedName = @"trackingId", + PossibleTypes = new [] { typeof(string) })] + string TrackingInformationTrackingId { get; set; } + /// Tracking URL of the shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tracking URL of the shipment.", + SerializedName = @"trackingUrl", + PossibleTypes = new [] { typeof(string) })] + string TrackingInformationTrackingUrl { get; set; } + + } + /// Order properties. + internal partial interface IOrderPropertiesInternal + + { + /// The contact details. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContactDetails ContactInformation { get; set; } + /// The name of the company. + string ContactInformationCompanyName { get; set; } + /// The contact person name. + string ContactInformationContactPerson { get; set; } + /// The email list. + string[] ContactInformationEmailList { get; set; } + /// The phone number. + string ContactInformationPhone { get; set; } + /// Current status of the order. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus CurrentStatus { get; set; } + /// + /// Dictionary to hold generic information which is not stored + /// by the already existing properties + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails CurrentStatusAdditionalOrderDetail { get; set; } + /// Comments related to this status change. + string CurrentStatusComment { get; set; } + /// Status of the order as per the allowed status types. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState? CurrentStatusStatus { get; set; } + /// Tracking information related to the state in the ordering flow + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo CurrentStatusTrackingInformation { get; set; } + /// Time of status update. + global::System.DateTime? CurrentStatusUpdateDateTime { get; set; } + /// + /// Tracking information for the package delivered to the customer whether it has an original or a replacement device. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[] DeliveryTrackingInfo { get; set; } + /// List of status changes in the order. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus[] OrderHistory { get; set; } + /// It specify the order resource id. + string OrderId { get; set; } + /// + /// Tracking information for the package returned from the customer whether it has an original or a replacement device. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo[] ReturnTrackingInfo { get; set; } + /// Serial number of the device. + string SerialNumber { get; set; } + /// ShipmentType of the order + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType? ShipmentType { get; set; } + /// The shipping address. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddress ShippingAddress { get; set; } + /// The city name. + string ShippingAddressCity { get; set; } + /// The country name. + string ShippingAddressCountry { get; set; } + /// The address line1. + string ShippingAddressLine1 { get; set; } + /// The address line2. + string ShippingAddressLine2 { get; set; } + /// The address line3. + string ShippingAddressLine3 { get; set; } + /// The postal code. + string ShippingAddressPostalCode { get; set; } + /// The state name. + string ShippingAddressState { get; set; } + /// Name of the carrier used in the delivery. + string TrackingInformationCarrierName { get; set; } + /// Serial number of the device being tracked. + string TrackingInformationSerialNumber { get; set; } + /// Tracking ID of the shipment. + string TrackingInformationTrackingId { get; set; } + /// Tracking URL of the shipment. + string TrackingInformationTrackingUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderProperties.json.cs new file mode 100644 index 000000000000..4255ad6b950c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderProperties.json.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Order properties. + public partial class OrderProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new OrderProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal OrderProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_contactInformation = If( json?.PropertyT("contactInformation"), out var __jsonContactInformation) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ContactDetails.FromJson(__jsonContactInformation) : ContactInformation;} + {_shippingAddress = If( json?.PropertyT("shippingAddress"), out var __jsonShippingAddress) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Address.FromJson(__jsonShippingAddress) : ShippingAddress;} + {_currentStatus = If( json?.PropertyT("currentStatus"), out var __jsonCurrentStatus) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatus.FromJson(__jsonCurrentStatus) : CurrentStatus;} + {_orderId = If( json?.PropertyT("orderId"), out var __jsonOrderId) ? (string)__jsonOrderId : (string)OrderId;} + {_orderHistory = If( json?.PropertyT("orderHistory"), out var __jsonOrderHistory) ? If( __jsonOrderHistory as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IOrderStatus) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatus.FromJson(__u) )) ))() : null : OrderHistory;} + {_serialNumber = If( json?.PropertyT("serialNumber"), out var __jsonSerialNumber) ? (string)__jsonSerialNumber : (string)SerialNumber;} + {_deliveryTrackingInfo = If( json?.PropertyT("deliveryTrackingInfo"), out var __jsonDeliveryTrackingInfo) ? If( __jsonDeliveryTrackingInfo as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.ITrackingInfo) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfo.FromJson(__p) )) ))() : null : DeliveryTrackingInfo;} + {_returnTrackingInfo = If( json?.PropertyT("returnTrackingInfo"), out var __jsonReturnTrackingInfo) ? If( __jsonReturnTrackingInfo as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfo.FromJson(__k) )) ))() : null : ReturnTrackingInfo;} + {_shipmentType = If( json?.PropertyT("shipmentType"), out var __jsonShipmentType) ? (string)__jsonShipmentType : (string)ShipmentType;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._contactInformation ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._contactInformation.ToJson(null,serializationMode) : null, "contactInformation" ,container.Add ); + AddIf( null != this._shippingAddress ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._shippingAddress.ToJson(null,serializationMode) : null, "shippingAddress" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._currentStatus ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._currentStatus.ToJson(null,serializationMode) : null, "currentStatus" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._orderId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._orderId.ToString()) : null, "orderId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._orderHistory) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._orderHistory ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("orderHistory",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._serialNumber)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._serialNumber.ToString()) : null, "serialNumber" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._deliveryTrackingInfo) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __s in this._deliveryTrackingInfo ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("deliveryTrackingInfo",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._returnTrackingInfo) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __n in this._returnTrackingInfo ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("returnTrackingInfo",__m); + } + } + AddIf( null != (((object)this._shipmentType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._shipmentType.ToString()) : null, "shipmentType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatus.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatus.PowerShell.cs new file mode 100644 index 000000000000..93eaa11a3f9f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatus.PowerShell.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Represents a single status change. + [System.ComponentModel.TypeConverter(typeof(OrderStatusTypeConverter))] + public partial class OrderStatus + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IOrderStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OrderStatus(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.DataBoxEdge.Models.Api20220301.IOrderStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OrderStatus(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.DataBoxEdge.Models.Api20220301.IOrderStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OrderStatus(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TrackingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformation = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo) content.GetValueForProperty("TrackingInformation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformation, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState.CreateFrom); + } + if (content.Contains("UpdateDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).UpdateDateTime = (global::System.DateTime?) content.GetValueForProperty("UpdateDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).UpdateDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Comment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).Comment = (string) content.GetValueForProperty("Comment",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).Comment, global::System.Convert.ToString); + } + if (content.Contains("AdditionalOrderDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).AdditionalOrderDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails) content.GetValueForProperty("AdditionalOrderDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).AdditionalOrderDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatusAdditionalOrderDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("TrackingInformationSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformationSerialNumber = (string) content.GetValueForProperty("TrackingInformationSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformationSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("TrackingInformationCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformationCarrierName = (string) content.GetValueForProperty("TrackingInformationCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformationCarrierName, global::System.Convert.ToString); + } + if (content.Contains("TrackingInformationTrackingId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformationTrackingId = (string) content.GetValueForProperty("TrackingInformationTrackingId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformationTrackingId, global::System.Convert.ToString); + } + if (content.Contains("TrackingInformationTrackingUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformationTrackingUrl = (string) content.GetValueForProperty("TrackingInformationTrackingUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformationTrackingUrl, 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 OrderStatus(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TrackingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformation = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo) content.GetValueForProperty("TrackingInformation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformation, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState.CreateFrom); + } + if (content.Contains("UpdateDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).UpdateDateTime = (global::System.DateTime?) content.GetValueForProperty("UpdateDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).UpdateDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Comment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).Comment = (string) content.GetValueForProperty("Comment",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).Comment, global::System.Convert.ToString); + } + if (content.Contains("AdditionalOrderDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).AdditionalOrderDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails) content.GetValueForProperty("AdditionalOrderDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).AdditionalOrderDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatusAdditionalOrderDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("TrackingInformationSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformationSerialNumber = (string) content.GetValueForProperty("TrackingInformationSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformationSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("TrackingInformationCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformationCarrierName = (string) content.GetValueForProperty("TrackingInformationCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformationCarrierName, global::System.Convert.ToString); + } + if (content.Contains("TrackingInformationTrackingId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformationTrackingId = (string) content.GetValueForProperty("TrackingInformationTrackingId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformationTrackingId, global::System.Convert.ToString); + } + if (content.Contains("TrackingInformationTrackingUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformationTrackingUrl = (string) content.GetValueForProperty("TrackingInformationTrackingUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal)this).TrackingInformationTrackingUrl, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Represents a single status change. + [System.ComponentModel.TypeConverter(typeof(OrderStatusTypeConverter))] + public partial interface IOrderStatus + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatus.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatus.TypeConverter.cs new file mode 100644 index 000000000000..ff43e9ba231f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatus.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OrderStatusTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IOrderStatus ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OrderStatus.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OrderStatus.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OrderStatus.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/databoxedge/generated/api/Models/Api20220301/OrderStatus.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatus.cs new file mode 100644 index 000000000000..33ecbe51134d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatus.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Represents a single status change. + public partial class OrderStatus : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails _additionalOrderDetail; + + /// + /// Dictionary to hold generic information which is not stored + /// by the already existing properties + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails AdditionalOrderDetail { get => (this._additionalOrderDetail = this._additionalOrderDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatusAdditionalOrderDetails()); } + + /// Backing field for property. + private string _comment; + + /// Comments related to this status change. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Comment { get => this._comment; set => this._comment = value; } + + /// Internal Acessors for AdditionalOrderDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal.AdditionalOrderDetail { get => (this._additionalOrderDetail = this._additionalOrderDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatusAdditionalOrderDetails()); set { {_additionalOrderDetail = value;} } } + + /// Internal Acessors for TrackingInformation + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal.TrackingInformation { get => (this._trackingInformation = this._trackingInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfo()); set { {_trackingInformation = value;} } } + + /// Internal Acessors for UpdateDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusInternal.UpdateDateTime { get => this._updateDateTime; set { {_updateDateTime = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState _status; + + /// Status of the order as per the allowed status types. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState Status { get => this._status; set => this._status = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo _trackingInformation; + + /// Tracking information related to the state in the ordering flow + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo TrackingInformation { get => (this._trackingInformation = this._trackingInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfo()); } + + /// Name of the carrier used in the delivery. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string TrackingInformationCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)TrackingInformation).CarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)TrackingInformation).CarrierName = value ?? null; } + + /// Serial number of the device being tracked. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string TrackingInformationSerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)TrackingInformation).SerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)TrackingInformation).SerialNumber = value ?? null; } + + /// Tracking ID of the shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string TrackingInformationTrackingId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)TrackingInformation).TrackingId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)TrackingInformation).TrackingId = value ?? null; } + + /// Tracking URL of the shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string TrackingInformationTrackingUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)TrackingInformation).TrackingUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)TrackingInformation).TrackingUrl = value ?? null; } + + /// Backing field for property. + private global::System.DateTime? _updateDateTime; + + /// Time of status update. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? UpdateDateTime { get => this._updateDateTime; } + + /// Creates an new instance. + public OrderStatus() + { + + } + } + /// Represents a single status change. + public partial interface IOrderStatus : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// + /// Dictionary to hold generic information which is not stored + /// by the already existing properties + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Dictionary to hold generic information which is not stored + by the already existing properties", + SerializedName = @"additionalOrderDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails AdditionalOrderDetail { get; } + /// Comments related to this status change. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Comments related to this status change.", + SerializedName = @"comments", + PossibleTypes = new [] { typeof(string) })] + string Comment { get; set; } + /// Status of the order as per the allowed status types. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Status of the order as per the allowed status types.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState Status { get; set; } + /// Name of the carrier used in the delivery. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the carrier used in the delivery.", + SerializedName = @"carrierName", + PossibleTypes = new [] { typeof(string) })] + string TrackingInformationCarrierName { get; set; } + /// Serial number of the device being tracked. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Serial number of the device being tracked.", + SerializedName = @"serialNumber", + PossibleTypes = new [] { typeof(string) })] + string TrackingInformationSerialNumber { get; set; } + /// Tracking ID of the shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tracking ID of the shipment.", + SerializedName = @"trackingId", + PossibleTypes = new [] { typeof(string) })] + string TrackingInformationTrackingId { get; set; } + /// Tracking URL of the shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tracking URL of the shipment.", + SerializedName = @"trackingUrl", + PossibleTypes = new [] { typeof(string) })] + string TrackingInformationTrackingUrl { get; set; } + /// Time of status update. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Time of status update.", + SerializedName = @"updateDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UpdateDateTime { get; } + + } + /// Represents a single status change. + internal partial interface IOrderStatusInternal + + { + /// + /// Dictionary to hold generic information which is not stored + /// by the already existing properties + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails AdditionalOrderDetail { get; set; } + /// Comments related to this status change. + string Comment { get; set; } + /// Status of the order as per the allowed status types. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState Status { get; set; } + /// Tracking information related to the state in the ordering flow + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo TrackingInformation { get; set; } + /// Name of the carrier used in the delivery. + string TrackingInformationCarrierName { get; set; } + /// Serial number of the device being tracked. + string TrackingInformationSerialNumber { get; set; } + /// Tracking ID of the shipment. + string TrackingInformationTrackingId { get; set; } + /// Tracking URL of the shipment. + string TrackingInformationTrackingUrl { get; set; } + /// Time of status update. + global::System.DateTime? UpdateDateTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatus.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatus.json.cs new file mode 100644 index 000000000000..466a2e9b3995 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatus.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Represents a single status change. + public partial class OrderStatus + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new OrderStatus(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal OrderStatus(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_trackingInformation = If( json?.PropertyT("trackingInformation"), out var __jsonTrackingInformation) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TrackingInfo.FromJson(__jsonTrackingInformation) : TrackingInformation;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_updateDateTime = If( json?.PropertyT("updateDateTime"), out var __jsonUpdateDateTime) ? global::System.DateTime.TryParse((string)__jsonUpdateDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUpdateDateTimeValue) ? __jsonUpdateDateTimeValue : UpdateDateTime : UpdateDateTime;} + {_comment = If( json?.PropertyT("comments"), out var __jsonComments) ? (string)__jsonComments : (string)Comment;} + {_additionalOrderDetail = If( json?.PropertyT("additionalOrderDetails"), out var __jsonAdditionalOrderDetails) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.OrderStatusAdditionalOrderDetails.FromJson(__jsonAdditionalOrderDetails) : AdditionalOrderDetail;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._trackingInformation ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._trackingInformation.ToJson(null,serializationMode) : null, "trackingInformation" ,container.Add ); + } + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._updateDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._updateDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "updateDateTime" ,container.Add ); + } + AddIf( null != (((object)this._comment)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._comment.ToString()) : null, "comments" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._additionalOrderDetail ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._additionalOrderDetail.ToJson(null,serializationMode) : null, "additionalOrderDetails" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatusAdditionalOrderDetails.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatusAdditionalOrderDetails.PowerShell.cs new file mode 100644 index 000000000000..c5791767e041 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatusAdditionalOrderDetails.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// Dictionary to hold generic information which is not stored + /// by the already existing properties + /// + [System.ComponentModel.TypeConverter(typeof(OrderStatusAdditionalOrderDetailsTypeConverter))] + public partial class OrderStatusAdditionalOrderDetails + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OrderStatusAdditionalOrderDetails(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.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OrderStatusAdditionalOrderDetails(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.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OrderStatusAdditionalOrderDetails(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 OrderStatusAdditionalOrderDetails(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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Dictionary to hold generic information which is not stored + /// by the already existing properties + [System.ComponentModel.TypeConverter(typeof(OrderStatusAdditionalOrderDetailsTypeConverter))] + public partial interface IOrderStatusAdditionalOrderDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatusAdditionalOrderDetails.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatusAdditionalOrderDetails.TypeConverter.cs new file mode 100644 index 000000000000..fbfa3eff334e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatusAdditionalOrderDetails.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OrderStatusAdditionalOrderDetailsTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OrderStatusAdditionalOrderDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OrderStatusAdditionalOrderDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OrderStatusAdditionalOrderDetails.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/databoxedge/generated/api/Models/Api20220301/OrderStatusAdditionalOrderDetails.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatusAdditionalOrderDetails.cs new file mode 100644 index 000000000000..4c880ef6aa57 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatusAdditionalOrderDetails.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// Dictionary to hold generic information which is not stored + /// by the already existing properties + /// + public partial class OrderStatusAdditionalOrderDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetailsInternal + { + + /// Creates an new instance. + public OrderStatusAdditionalOrderDetails() + { + + } + } + /// Dictionary to hold generic information which is not stored + /// by the already existing properties + public partial interface IOrderStatusAdditionalOrderDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray + { + + } + /// Dictionary to hold generic information which is not stored + /// by the already existing properties + internal partial interface IOrderStatusAdditionalOrderDetailsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatusAdditionalOrderDetails.dictionary.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatusAdditionalOrderDetails.dictionary.cs new file mode 100644 index 000000000000..385140edc297 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatusAdditionalOrderDetails.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + public partial class OrderStatusAdditionalOrderDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.OrderStatusAdditionalOrderDetails source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatusAdditionalOrderDetails.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatusAdditionalOrderDetails.json.cs new file mode 100644 index 000000000000..5b1288123c13 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/OrderStatusAdditionalOrderDetails.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// Dictionary to hold generic information which is not stored + /// by the already existing properties + /// + public partial class OrderStatusAdditionalOrderDetails + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrderStatusAdditionalOrderDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new OrderStatusAdditionalOrderDetails(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + /// + internal OrderStatusAdditionalOrderDetails(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerEventTrigger.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerEventTrigger.PowerShell.cs new file mode 100644 index 000000000000..d0af98fd9542 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerEventTrigger.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Trigger details. + [System.ComponentModel.TypeConverter(typeof(PeriodicTimerEventTriggerTypeConverter))] + public partial class PeriodicTimerEventTrigger + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTrigger DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PeriodicTimerEventTrigger(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.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTrigger DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PeriodicTimerEventTrigger(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.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTrigger FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PeriodicTimerEventTrigger(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.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.PeriodicTimerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType.CreateFrom); + } + if (content.Contains("SourceInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SourceInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfo) content.GetValueForProperty("SourceInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SourceInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.PeriodicTimerSourceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SinkInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SinkInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo) content.GetValueForProperty("SinkInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SinkInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleSinkInfoTypeConverter.ConvertFrom); + } + if (content.Contains("CustomContextTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).CustomContextTag = (string) content.GetValueForProperty("CustomContextTag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).CustomContextTag, global::System.Convert.ToString); + } + if (content.Contains("SourceInfoStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SourceInfoStartTime = (global::System.DateTime) content.GetValueForProperty("SourceInfoStartTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SourceInfoStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceInfoSchedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SourceInfoSchedule = (string) content.GetValueForProperty("SourceInfoSchedule",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SourceInfoSchedule, global::System.Convert.ToString); + } + if (content.Contains("SourceInfoTopic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SourceInfoTopic = (string) content.GetValueForProperty("SourceInfoTopic",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SourceInfoTopic, global::System.Convert.ToString); + } + if (content.Contains("SinkInfoRoleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SinkInfoRoleId = (string) content.GetValueForProperty("SinkInfoRoleId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SinkInfoRoleId, 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 PeriodicTimerEventTrigger(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.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.PeriodicTimerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType.CreateFrom); + } + if (content.Contains("SourceInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SourceInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfo) content.GetValueForProperty("SourceInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SourceInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.PeriodicTimerSourceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SinkInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SinkInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo) content.GetValueForProperty("SinkInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SinkInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleSinkInfoTypeConverter.ConvertFrom); + } + if (content.Contains("CustomContextTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).CustomContextTag = (string) content.GetValueForProperty("CustomContextTag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).CustomContextTag, global::System.Convert.ToString); + } + if (content.Contains("SourceInfoStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SourceInfoStartTime = (global::System.DateTime) content.GetValueForProperty("SourceInfoStartTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SourceInfoStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceInfoSchedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SourceInfoSchedule = (string) content.GetValueForProperty("SourceInfoSchedule",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SourceInfoSchedule, global::System.Convert.ToString); + } + if (content.Contains("SourceInfoTopic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SourceInfoTopic = (string) content.GetValueForProperty("SourceInfoTopic",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SourceInfoTopic, global::System.Convert.ToString); + } + if (content.Contains("SinkInfoRoleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SinkInfoRoleId = (string) content.GetValueForProperty("SinkInfoRoleId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal)this).SinkInfoRoleId, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Trigger details. + [System.ComponentModel.TypeConverter(typeof(PeriodicTimerEventTriggerTypeConverter))] + public partial interface IPeriodicTimerEventTrigger + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerEventTrigger.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerEventTrigger.TypeConverter.cs new file mode 100644 index 000000000000..ac564649e9ab --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerEventTrigger.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PeriodicTimerEventTriggerTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTrigger ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTrigger).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PeriodicTimerEventTrigger.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PeriodicTimerEventTrigger.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PeriodicTimerEventTrigger.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/databoxedge/generated/api/Models/Api20220301/PeriodicTimerEventTrigger.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerEventTrigger.cs new file mode 100644 index 000000000000..d2245354c363 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerEventTrigger.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Trigger details. + public partial class PeriodicTimerEventTrigger : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTrigger, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger __trigger = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Trigger(); + + /// + /// A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger + /// is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CustomContextTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)Property).CustomContextTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)Property).CustomContextTag = value ?? null; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__trigger).Id; } + + /// Trigger Kind. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType Kind { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).Kind; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).Kind = value ; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__trigger).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__trigger).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__trigger).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__trigger).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__trigger).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__trigger).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.PeriodicTimerProperties()); set { {_property = value;} } } + + /// Internal Acessors for SinkInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal.SinkInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)Property).SinkInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)Property).SinkInfo = value; } + + /// Internal Acessors for SourceInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTriggerInternal.SourceInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)Property).SourceInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)Property).SourceInfo = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemData = value; } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__trigger).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerProperties _property; + + /// Periodic timer trigger properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.PeriodicTimerProperties()); set => this._property = value; } + + /// Compute role ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SinkInfoRoleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)Property).SinkInfoRoleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)Property).SinkInfoRoleId = value ; } + + /// + /// Periodic frequency at which timer event needs to be raised. Supports daily, hourly, minutes, and seconds. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SourceInfoSchedule { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)Property).SourceInfoSchedule; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)Property).SourceInfoSchedule = value ; } + + /// + /// The time of the day that results in a valid trigger. Schedule is computed with reference to the time specified upto seconds. + /// If timezone is not specified the time will considered to be in device timezone. The value will always be returned as UTC + /// time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime SourceInfoStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)Property).SourceInfoStartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)Property).SourceInfoStartTime = value ; } + + /// Topic where periodic events are published to IoT device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SourceInfoTopic { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)Property).SourceInfoTopic; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)Property).SourceInfoTopic = value ?? null; } + + /// Metadata pertaining to creation and last modification of Trigger + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)__trigger).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__trigger).Type; } + + /// Creates an new instance. + public PeriodicTimerEventTrigger() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trigger), __trigger); + await eventListener.AssertObjectIsValid(nameof(__trigger), __trigger); + } + } + /// Trigger details. + public partial interface IPeriodicTimerEventTrigger : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger + { + /// + /// A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger + /// is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module.", + SerializedName = @"customContextTag", + PossibleTypes = new [] { typeof(string) })] + string CustomContextTag { get; set; } + /// Compute role ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Compute role ID.", + SerializedName = @"roleId", + PossibleTypes = new [] { typeof(string) })] + string SinkInfoRoleId { get; set; } + /// + /// Periodic frequency at which timer event needs to be raised. Supports daily, hourly, minutes, and seconds. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Periodic frequency at which timer event needs to be raised. Supports daily, hourly, minutes, and seconds.", + SerializedName = @"schedule", + PossibleTypes = new [] { typeof(string) })] + string SourceInfoSchedule { get; set; } + /// + /// The time of the day that results in a valid trigger. Schedule is computed with reference to the time specified upto seconds. + /// If timezone is not specified the time will considered to be in device timezone. The value will always be returned as UTC + /// time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The time of the day that results in a valid trigger. Schedule is computed with reference to the time specified upto seconds. If timezone is not specified the time will considered to be in device timezone. The value will always be returned as UTC time.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime SourceInfoStartTime { get; set; } + /// Topic where periodic events are published to IoT device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Topic where periodic events are published to IoT device.", + SerializedName = @"topic", + PossibleTypes = new [] { typeof(string) })] + string SourceInfoTopic { get; set; } + + } + /// Trigger details. + internal partial interface IPeriodicTimerEventTriggerInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal + { + /// + /// A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger + /// is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + /// + string CustomContextTag { get; set; } + /// Periodic timer trigger properties. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerProperties Property { get; set; } + /// Role Sink information. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo SinkInfo { get; set; } + /// Compute role ID. + string SinkInfoRoleId { get; set; } + /// Periodic timer details. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfo SourceInfo { get; set; } + /// + /// Periodic frequency at which timer event needs to be raised. Supports daily, hourly, minutes, and seconds. + /// + string SourceInfoSchedule { get; set; } + /// + /// The time of the day that results in a valid trigger. Schedule is computed with reference to the time specified upto seconds. + /// If timezone is not specified the time will considered to be in device timezone. The value will always be returned as UTC + /// time. + /// + global::System.DateTime SourceInfoStartTime { get; set; } + /// Topic where periodic events are published to IoT device. + string SourceInfoTopic { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerEventTrigger.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerEventTrigger.json.cs new file mode 100644 index 000000000000..bb15102d2433 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerEventTrigger.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Trigger details. + public partial class PeriodicTimerEventTrigger + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTrigger. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTrigger. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerEventTrigger FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new PeriodicTimerEventTrigger(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal PeriodicTimerEventTrigger(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __trigger = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Trigger(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.PeriodicTimerProperties.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __trigger?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/PeriodicTimerProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerProperties.PowerShell.cs new file mode 100644 index 000000000000..a1bb3a7517a9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Periodic timer trigger properties. + [System.ComponentModel.TypeConverter(typeof(PeriodicTimerPropertiesTypeConverter))] + public partial class PeriodicTimerProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IPeriodicTimerProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PeriodicTimerProperties(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.DataBoxEdge.Models.Api20220301.IPeriodicTimerProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PeriodicTimerProperties(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.DataBoxEdge.Models.Api20220301.IPeriodicTimerProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PeriodicTimerProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SourceInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfo) content.GetValueForProperty("SourceInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SourceInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.PeriodicTimerSourceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SinkInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SinkInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo) content.GetValueForProperty("SinkInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SinkInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleSinkInfoTypeConverter.ConvertFrom); + } + if (content.Contains("CustomContextTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).CustomContextTag = (string) content.GetValueForProperty("CustomContextTag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).CustomContextTag, global::System.Convert.ToString); + } + if (content.Contains("SourceInfoStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SourceInfoStartTime = (global::System.DateTime) content.GetValueForProperty("SourceInfoStartTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SourceInfoStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceInfoSchedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SourceInfoSchedule = (string) content.GetValueForProperty("SourceInfoSchedule",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SourceInfoSchedule, global::System.Convert.ToString); + } + if (content.Contains("SourceInfoTopic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SourceInfoTopic = (string) content.GetValueForProperty("SourceInfoTopic",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SourceInfoTopic, global::System.Convert.ToString); + } + if (content.Contains("SinkInfoRoleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SinkInfoRoleId = (string) content.GetValueForProperty("SinkInfoRoleId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SinkInfoRoleId, 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 PeriodicTimerProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SourceInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfo) content.GetValueForProperty("SourceInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SourceInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.PeriodicTimerSourceInfoTypeConverter.ConvertFrom); + } + if (content.Contains("SinkInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SinkInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo) content.GetValueForProperty("SinkInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SinkInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleSinkInfoTypeConverter.ConvertFrom); + } + if (content.Contains("CustomContextTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).CustomContextTag = (string) content.GetValueForProperty("CustomContextTag",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).CustomContextTag, global::System.Convert.ToString); + } + if (content.Contains("SourceInfoStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SourceInfoStartTime = (global::System.DateTime) content.GetValueForProperty("SourceInfoStartTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SourceInfoStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceInfoSchedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SourceInfoSchedule = (string) content.GetValueForProperty("SourceInfoSchedule",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SourceInfoSchedule, global::System.Convert.ToString); + } + if (content.Contains("SourceInfoTopic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SourceInfoTopic = (string) content.GetValueForProperty("SourceInfoTopic",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SourceInfoTopic, global::System.Convert.ToString); + } + if (content.Contains("SinkInfoRoleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SinkInfoRoleId = (string) content.GetValueForProperty("SinkInfoRoleId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal)this).SinkInfoRoleId, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Periodic timer trigger properties. + [System.ComponentModel.TypeConverter(typeof(PeriodicTimerPropertiesTypeConverter))] + public partial interface IPeriodicTimerProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerProperties.TypeConverter.cs new file mode 100644 index 000000000000..aa48078bfa79 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PeriodicTimerPropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IPeriodicTimerProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PeriodicTimerProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PeriodicTimerProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PeriodicTimerProperties.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/databoxedge/generated/api/Models/Api20220301/PeriodicTimerProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerProperties.cs new file mode 100644 index 000000000000..a5ad66771da5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerProperties.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Periodic timer trigger properties. + public partial class PeriodicTimerProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal + { + + /// Backing field for property. + private string _customContextTag; + + /// + /// A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger + /// is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string CustomContextTag { get => this._customContextTag; set => this._customContextTag = value; } + + /// Internal Acessors for SinkInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal.SinkInfo { get => (this._sinkInfo = this._sinkInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleSinkInfo()); set { {_sinkInfo = value;} } } + + /// Internal Acessors for SourceInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerPropertiesInternal.SourceInfo { get => (this._sourceInfo = this._sourceInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.PeriodicTimerSourceInfo()); set { {_sourceInfo = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo _sinkInfo; + + /// Role Sink information. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo SinkInfo { get => (this._sinkInfo = this._sinkInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleSinkInfo()); set => this._sinkInfo = value; } + + /// Compute role ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SinkInfoRoleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfoInternal)SinkInfo).RoleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfoInternal)SinkInfo).RoleId = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfo _sourceInfo; + + /// Periodic timer details. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfo SourceInfo { get => (this._sourceInfo = this._sourceInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.PeriodicTimerSourceInfo()); set => this._sourceInfo = value; } + + /// + /// Periodic frequency at which timer event needs to be raised. Supports daily, hourly, minutes, and seconds. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SourceInfoSchedule { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfoInternal)SourceInfo).Schedule; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfoInternal)SourceInfo).Schedule = value ; } + + /// + /// The time of the day that results in a valid trigger. Schedule is computed with reference to the time specified upto seconds. + /// If timezone is not specified the time will considered to be in device timezone. The value will always be returned as UTC + /// time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime SourceInfoStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfoInternal)SourceInfo).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfoInternal)SourceInfo).StartTime = value ; } + + /// Topic where periodic events are published to IoT device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SourceInfoTopic { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfoInternal)SourceInfo).Topic; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfoInternal)SourceInfo).Topic = value ?? null; } + + /// Creates an new instance. + public PeriodicTimerProperties() + { + + } + } + /// Periodic timer trigger properties. + public partial interface IPeriodicTimerProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// + /// A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger + /// is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module.", + SerializedName = @"customContextTag", + PossibleTypes = new [] { typeof(string) })] + string CustomContextTag { get; set; } + /// Compute role ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Compute role ID.", + SerializedName = @"roleId", + PossibleTypes = new [] { typeof(string) })] + string SinkInfoRoleId { get; set; } + /// + /// Periodic frequency at which timer event needs to be raised. Supports daily, hourly, minutes, and seconds. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Periodic frequency at which timer event needs to be raised. Supports daily, hourly, minutes, and seconds.", + SerializedName = @"schedule", + PossibleTypes = new [] { typeof(string) })] + string SourceInfoSchedule { get; set; } + /// + /// The time of the day that results in a valid trigger. Schedule is computed with reference to the time specified upto seconds. + /// If timezone is not specified the time will considered to be in device timezone. The value will always be returned as UTC + /// time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The time of the day that results in a valid trigger. Schedule is computed with reference to the time specified upto seconds. If timezone is not specified the time will considered to be in device timezone. The value will always be returned as UTC time.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime SourceInfoStartTime { get; set; } + /// Topic where periodic events are published to IoT device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Topic where periodic events are published to IoT device.", + SerializedName = @"topic", + PossibleTypes = new [] { typeof(string) })] + string SourceInfoTopic { get; set; } + + } + /// Periodic timer trigger properties. + internal partial interface IPeriodicTimerPropertiesInternal + + { + /// + /// A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger + /// is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + /// + string CustomContextTag { get; set; } + /// Role Sink information. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo SinkInfo { get; set; } + /// Compute role ID. + string SinkInfoRoleId { get; set; } + /// Periodic timer details. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfo SourceInfo { get; set; } + /// + /// Periodic frequency at which timer event needs to be raised. Supports daily, hourly, minutes, and seconds. + /// + string SourceInfoSchedule { get; set; } + /// + /// The time of the day that results in a valid trigger. Schedule is computed with reference to the time specified upto seconds. + /// If timezone is not specified the time will considered to be in device timezone. The value will always be returned as UTC + /// time. + /// + global::System.DateTime SourceInfoStartTime { get; set; } + /// Topic where periodic events are published to IoT device. + string SourceInfoTopic { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerProperties.json.cs new file mode 100644 index 000000000000..d16ad6927512 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Periodic timer trigger properties. + public partial class PeriodicTimerProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new PeriodicTimerProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal PeriodicTimerProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceInfo = If( json?.PropertyT("sourceInfo"), out var __jsonSourceInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.PeriodicTimerSourceInfo.FromJson(__jsonSourceInfo) : SourceInfo;} + {_sinkInfo = If( json?.PropertyT("sinkInfo"), out var __jsonSinkInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleSinkInfo.FromJson(__jsonSinkInfo) : SinkInfo;} + {_customContextTag = If( json?.PropertyT("customContextTag"), out var __jsonCustomContextTag) ? (string)__jsonCustomContextTag : (string)CustomContextTag;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sourceInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._sourceInfo.ToJson(null,serializationMode) : null, "sourceInfo" ,container.Add ); + AddIf( null != this._sinkInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._sinkInfo.ToJson(null,serializationMode) : null, "sinkInfo" ,container.Add ); + AddIf( null != (((object)this._customContextTag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._customContextTag.ToString()) : null, "customContextTag" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerSourceInfo.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerSourceInfo.PowerShell.cs new file mode 100644 index 000000000000..00d2e0df0a38 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerSourceInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Periodic timer event source. + [System.ComponentModel.TypeConverter(typeof(PeriodicTimerSourceInfoTypeConverter))] + public partial class PeriodicTimerSourceInfo + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PeriodicTimerSourceInfo(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.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PeriodicTimerSourceInfo(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.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PeriodicTimerSourceInfo(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.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfoInternal)this).StartTime = (global::System.DateTime) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfoInternal)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("Schedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfoInternal)this).Schedule = (string) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfoInternal)this).Schedule, global::System.Convert.ToString); + } + if (content.Contains("Topic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfoInternal)this).Topic = (string) content.GetValueForProperty("Topic",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfoInternal)this).Topic, 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 PeriodicTimerSourceInfo(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.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfoInternal)this).StartTime = (global::System.DateTime) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfoInternal)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("Schedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfoInternal)this).Schedule = (string) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfoInternal)this).Schedule, global::System.Convert.ToString); + } + if (content.Contains("Topic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfoInternal)this).Topic = (string) content.GetValueForProperty("Topic",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfoInternal)this).Topic, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Periodic timer event source. + [System.ComponentModel.TypeConverter(typeof(PeriodicTimerSourceInfoTypeConverter))] + public partial interface IPeriodicTimerSourceInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerSourceInfo.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerSourceInfo.TypeConverter.cs new file mode 100644 index 000000000000..24e4359de18d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerSourceInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PeriodicTimerSourceInfoTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PeriodicTimerSourceInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PeriodicTimerSourceInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PeriodicTimerSourceInfo.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/databoxedge/generated/api/Models/Api20220301/PeriodicTimerSourceInfo.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerSourceInfo.cs new file mode 100644 index 000000000000..f4a66c59e39a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerSourceInfo.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Periodic timer event source. + public partial class PeriodicTimerSourceInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfoInternal + { + + /// Backing field for property. + private string _schedule; + + /// + /// Periodic frequency at which timer event needs to be raised. Supports daily, hourly, minutes, and seconds. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Schedule { get => this._schedule; set => this._schedule = value; } + + /// Backing field for property. + private global::System.DateTime _startTime; + + /// + /// The time of the day that results in a valid trigger. Schedule is computed with reference to the time specified upto seconds. + /// If timezone is not specified the time will considered to be in device timezone. The value will always be returned as UTC + /// time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime StartTime { get => this._startTime; set => this._startTime = value; } + + /// Backing field for property. + private string _topic; + + /// Topic where periodic events are published to IoT device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Topic { get => this._topic; set => this._topic = value; } + + /// Creates an new instance. + public PeriodicTimerSourceInfo() + { + + } + } + /// Periodic timer event source. + public partial interface IPeriodicTimerSourceInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// + /// Periodic frequency at which timer event needs to be raised. Supports daily, hourly, minutes, and seconds. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Periodic frequency at which timer event needs to be raised. Supports daily, hourly, minutes, and seconds.", + SerializedName = @"schedule", + PossibleTypes = new [] { typeof(string) })] + string Schedule { get; set; } + /// + /// The time of the day that results in a valid trigger. Schedule is computed with reference to the time specified upto seconds. + /// If timezone is not specified the time will considered to be in device timezone. The value will always be returned as UTC + /// time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The time of the day that results in a valid trigger. Schedule is computed with reference to the time specified upto seconds. If timezone is not specified the time will considered to be in device timezone. The value will always be returned as UTC time.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime StartTime { get; set; } + /// Topic where periodic events are published to IoT device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Topic where periodic events are published to IoT device.", + SerializedName = @"topic", + PossibleTypes = new [] { typeof(string) })] + string Topic { get; set; } + + } + /// Periodic timer event source. + internal partial interface IPeriodicTimerSourceInfoInternal + + { + /// + /// Periodic frequency at which timer event needs to be raised. Supports daily, hourly, minutes, and seconds. + /// + string Schedule { get; set; } + /// + /// The time of the day that results in a valid trigger. Schedule is computed with reference to the time specified upto seconds. + /// If timezone is not specified the time will considered to be in device timezone. The value will always be returned as UTC + /// time. + /// + global::System.DateTime StartTime { get; set; } + /// Topic where periodic events are published to IoT device. + string Topic { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerSourceInfo.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerSourceInfo.json.cs new file mode 100644 index 000000000000..5a08a28fa1f6 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/PeriodicTimerSourceInfo.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Periodic timer event source. + public partial class PeriodicTimerSourceInfo + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IPeriodicTimerSourceInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new PeriodicTimerSourceInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal PeriodicTimerSourceInfo(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_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;} + {_schedule = If( json?.PropertyT("schedule"), out var __jsonSchedule) ? (string)__jsonSchedule : (string)Schedule;} + {_topic = If( json?.PropertyT("topic"), out var __jsonTopic) ? (string)__jsonTopic : (string)Topic;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._startTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "startTime" ,container.Add ); + AddIf( null != (((object)this._schedule)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._schedule.ToString()) : null, "schedule" ,container.Add ); + AddIf( null != (((object)this._topic)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._topic.ToString()) : null, "topic" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ProactiveLogCollectionSettingsProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ProactiveLogCollectionSettingsProperties.PowerShell.cs new file mode 100644 index 000000000000..96a9b9946eca --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ProactiveLogCollectionSettingsProperties.PowerShell.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The properties of proactive log collection settings. + [System.ComponentModel.TypeConverter(typeof(ProactiveLogCollectionSettingsPropertiesTypeConverter))] + public partial class ProactiveLogCollectionSettingsProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProactiveLogCollectionSettingsProperties(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.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProactiveLogCollectionSettingsProperties(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.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ProactiveLogCollectionSettingsProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("UserConsent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsPropertiesInternal)this).UserConsent = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent) content.GetValueForProperty("UserConsent",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsPropertiesInternal)this).UserConsent, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ProactiveLogCollectionSettingsProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("UserConsent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsPropertiesInternal)this).UserConsent = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent) content.GetValueForProperty("UserConsent",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsPropertiesInternal)this).UserConsent, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of proactive log collection settings. + [System.ComponentModel.TypeConverter(typeof(ProactiveLogCollectionSettingsPropertiesTypeConverter))] + public partial interface IProactiveLogCollectionSettingsProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ProactiveLogCollectionSettingsProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ProactiveLogCollectionSettingsProperties.TypeConverter.cs new file mode 100644 index 000000000000..791e528a2133 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ProactiveLogCollectionSettingsProperties.TypeConverter.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProactiveLogCollectionSettingsPropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProactiveLogCollectionSettingsProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProactiveLogCollectionSettingsProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProactiveLogCollectionSettingsProperties.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/databoxedge/generated/api/Models/Api20220301/ProactiveLogCollectionSettingsProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ProactiveLogCollectionSettingsProperties.cs new file mode 100644 index 000000000000..14e278085ca4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ProactiveLogCollectionSettingsProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The properties of proactive log collection settings. + public partial class ProactiveLogCollectionSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent _userConsent; + + /// Proactive diagnostic collection consent flag + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent UserConsent { get => this._userConsent; set => this._userConsent = value; } + + /// + /// Creates an new instance. + /// + public ProactiveLogCollectionSettingsProperties() + { + + } + } + /// The properties of proactive log collection settings. + public partial interface IProactiveLogCollectionSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Proactive diagnostic collection consent flag + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Proactive diagnostic collection consent flag", + SerializedName = @"userConsent", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent UserConsent { get; set; } + + } + /// The properties of proactive log collection settings. + internal partial interface IProactiveLogCollectionSettingsPropertiesInternal + + { + /// Proactive diagnostic collection consent flag + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent UserConsent { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ProactiveLogCollectionSettingsProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ProactiveLogCollectionSettingsProperties.json.cs new file mode 100644 index 000000000000..34e4ec9ae99f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ProactiveLogCollectionSettingsProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The properties of proactive log collection settings. + public partial class ProactiveLogCollectionSettingsProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IProactiveLogCollectionSettingsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ProactiveLogCollectionSettingsProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ProactiveLogCollectionSettingsProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_userConsent = If( json?.PropertyT("userConsent"), out var __jsonUserConsent) ? (string)__jsonUserConsent : (string)UserConsent;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._userConsent)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._userConsent.ToString()) : null, "userConsent" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/RawCertificateData.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RawCertificateData.PowerShell.cs new file mode 100644 index 000000000000..f2380420eed9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/RawCertificateData.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Raw Certificate Data. + [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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IRawCertificateData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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("AuthenticationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateDataInternal)this).AuthenticationType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType?) content.GetValueForProperty("AuthenticationType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateDataInternal)this).AuthenticationType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("Certificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateDataInternal)this).Certificate = (string) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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("AuthenticationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateDataInternal)this).AuthenticationType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType?) content.GetValueForProperty("AuthenticationType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateDataInternal)this).AuthenticationType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("Certificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateDataInternal)this).Certificate = (string) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Raw Certificate Data. + [System.ComponentModel.TypeConverter(typeof(RawCertificateDataTypeConverter))] + public partial interface IRawCertificateData + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/RawCertificateData.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RawCertificateData.TypeConverter.cs new file mode 100644 index 000000000000..80c3b8a1b266 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IRawCertificateData ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/RawCertificateData.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RawCertificateData.cs new file mode 100644 index 000000000000..ce3b5cb88944 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Raw Certificate Data. + public partial class RawCertificateData : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateData, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateDataInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType? _authenticationType; + + /// The authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType? AuthenticationType { get => this._authenticationType; set => this._authenticationType = value; } + + /// Backing field for property. + private string _certificate; + + /// The base64 encoded certificate raw data. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Certificate { get => this._certificate; set => this._certificate = value; } + + /// Creates an new instance. + public RawCertificateData() + { + + } + } + /// Raw Certificate Data. + public partial interface IRawCertificateData : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The authentication type.", + SerializedName = @"authenticationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType? AuthenticationType { get; set; } + /// The base64 encoded certificate raw data. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The base64 encoded certificate raw data.", + SerializedName = @"certificate", + PossibleTypes = new [] { typeof(string) })] + string Certificate { get; set; } + + } + /// Raw Certificate Data. + internal partial interface IRawCertificateDataInternal + + { + /// The authentication type. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType? AuthenticationType { get; set; } + /// The base64 encoded certificate raw data. + string Certificate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/RawCertificateData.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RawCertificateData.json.cs new file mode 100644 index 000000000000..344e6cc0c99b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/RawCertificateData.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Raw Certificate Data. + 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateData. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateData. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateData FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new RawCertificateData(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal RawCertificateData(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_authenticationType = If( json?.PropertyT("authenticationType"), out var __jsonAuthenticationType) ? (string)__jsonAuthenticationType : (string)AuthenticationType;} + {_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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._authenticationType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._authenticationType.ToString()) : null, "authenticationType" ,container.Add ); + AddIf( null != (((object)this._certificate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/RefreshDetails.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RefreshDetails.PowerShell.cs new file mode 100644 index 000000000000..9180ca0617b4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/RefreshDetails.PowerShell.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Fields for tracking refresh job on the share or container. + [System.ComponentModel.TypeConverter(typeof(RefreshDetailsTypeConverter))] + public partial class RefreshDetails + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IRefreshDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RefreshDetails(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.DataBoxEdge.Models.Api20220301.IRefreshDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RefreshDetails(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.DataBoxEdge.Models.Api20220301.IRefreshDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RefreshDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InProgressRefreshJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)this).InProgressRefreshJobId = (string) content.GetValueForProperty("InProgressRefreshJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)this).InProgressRefreshJobId, global::System.Convert.ToString); + } + if (content.Contains("LastCompletedRefreshJobTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)this).LastCompletedRefreshJobTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("LastCompletedRefreshJobTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)this).LastCompletedRefreshJobTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ErrorManifestFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)this).ErrorManifestFile = (string) content.GetValueForProperty("ErrorManifestFile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)this).ErrorManifestFile, global::System.Convert.ToString); + } + if (content.Contains("LastJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)this).LastJob = (string) content.GetValueForProperty("LastJob",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)this).LastJob, 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 RefreshDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InProgressRefreshJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)this).InProgressRefreshJobId = (string) content.GetValueForProperty("InProgressRefreshJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)this).InProgressRefreshJobId, global::System.Convert.ToString); + } + if (content.Contains("LastCompletedRefreshJobTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)this).LastCompletedRefreshJobTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("LastCompletedRefreshJobTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)this).LastCompletedRefreshJobTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ErrorManifestFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)this).ErrorManifestFile = (string) content.GetValueForProperty("ErrorManifestFile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)this).ErrorManifestFile, global::System.Convert.ToString); + } + if (content.Contains("LastJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)this).LastJob = (string) content.GetValueForProperty("LastJob",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)this).LastJob, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Fields for tracking refresh job on the share or container. + [System.ComponentModel.TypeConverter(typeof(RefreshDetailsTypeConverter))] + public partial interface IRefreshDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/RefreshDetails.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RefreshDetails.TypeConverter.cs new file mode 100644 index 000000000000..9a3c6485da30 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/RefreshDetails.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RefreshDetailsTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IRefreshDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RefreshDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RefreshDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RefreshDetails.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/databoxedge/generated/api/Models/Api20220301/RefreshDetails.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RefreshDetails.cs new file mode 100644 index 000000000000..9c6719c8f564 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/RefreshDetails.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Fields for tracking refresh job on the share or container. + public partial class RefreshDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal + { + + /// Backing field for property. + private string _errorManifestFile; + + /// + /// Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This + /// could be a failed job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ErrorManifestFile { get => this._errorManifestFile; set => this._errorManifestFile = value; } + + /// Backing field for property. + private string _inProgressRefreshJobId; + + /// + /// If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that + /// job. The field is empty if no job is in progress. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string InProgressRefreshJobId { get => this._inProgressRefreshJobId; set => this._inProgressRefreshJobId = value; } + + /// Backing field for property. + private global::System.DateTime? _lastCompletedRefreshJobTimeInUtc; + + /// + /// Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed + /// job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? LastCompletedRefreshJobTimeInUtc { get => this._lastCompletedRefreshJobTimeInUtc; set => this._lastCompletedRefreshJobTimeInUtc = value; } + + /// Backing field for property. + private string _lastJob; + + /// + /// Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a + /// successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string LastJob { get => this._lastJob; set => this._lastJob = value; } + + /// Creates an new instance. + public RefreshDetails() + { + + } + } + /// Fields for tracking refresh job on the share or container. + public partial interface IRefreshDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// + /// Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This + /// could be a failed job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This could be a failed job or a successful job.", + SerializedName = @"errorManifestFile", + PossibleTypes = new [] { typeof(string) })] + string ErrorManifestFile { get; set; } + /// + /// If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that + /// job. The field is empty if no job is in progress. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that job. The field is empty if no job is in progress.", + SerializedName = @"inProgressRefreshJobId", + PossibleTypes = new [] { typeof(string) })] + string InProgressRefreshJobId { get; set; } + /// + /// Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed + /// job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed job or a successful job.", + SerializedName = @"lastCompletedRefreshJobTimeInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastCompletedRefreshJobTimeInUtc { get; set; } + /// + /// Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a + /// successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a successful job.", + SerializedName = @"lastJob", + PossibleTypes = new [] { typeof(string) })] + string LastJob { get; set; } + + } + /// Fields for tracking refresh job on the share or container. + internal partial interface IRefreshDetailsInternal + + { + /// + /// Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This + /// could be a failed job or a successful job. + /// + string ErrorManifestFile { get; set; } + /// + /// If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that + /// job. The field is empty if no job is in progress. + /// + string InProgressRefreshJobId { get; set; } + /// + /// Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed + /// job or a successful job. + /// + global::System.DateTime? LastCompletedRefreshJobTimeInUtc { get; set; } + /// + /// Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a + /// successful job. + /// + string LastJob { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/RefreshDetails.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RefreshDetails.json.cs new file mode 100644 index 000000000000..e9c509f77243 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/RefreshDetails.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Fields for tracking refresh job on the share or container. + public partial class RefreshDetails + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new RefreshDetails(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal RefreshDetails(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_inProgressRefreshJobId = If( json?.PropertyT("inProgressRefreshJobId"), out var __jsonInProgressRefreshJobId) ? (string)__jsonInProgressRefreshJobId : (string)InProgressRefreshJobId;} + {_lastCompletedRefreshJobTimeInUtc = If( json?.PropertyT("lastCompletedRefreshJobTimeInUTC"), out var __jsonLastCompletedRefreshJobTimeInUtc) ? global::System.DateTime.TryParse((string)__jsonLastCompletedRefreshJobTimeInUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastCompletedRefreshJobTimeInUtcValue) ? __jsonLastCompletedRefreshJobTimeInUtcValue : LastCompletedRefreshJobTimeInUtc : LastCompletedRefreshJobTimeInUtc;} + {_errorManifestFile = If( json?.PropertyT("errorManifestFile"), out var __jsonErrorManifestFile) ? (string)__jsonErrorManifestFile : (string)ErrorManifestFile;} + {_lastJob = If( json?.PropertyT("lastJob"), out var __jsonLastJob) ? (string)__jsonLastJob : (string)LastJob;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._inProgressRefreshJobId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._inProgressRefreshJobId.ToString()) : null, "inProgressRefreshJobId" ,container.Add ); + AddIf( null != this._lastCompletedRefreshJobTimeInUtc ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._lastCompletedRefreshJobTimeInUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastCompletedRefreshJobTimeInUTC" ,container.Add ); + AddIf( null != (((object)this._errorManifestFile)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._errorManifestFile.ToString()) : null, "errorManifestFile" ,container.Add ); + AddIf( null != (((object)this._lastJob)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._lastJob.ToString()) : null, "lastJob" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/RemoteSupportSettings.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RemoteSupportSettings.PowerShell.cs new file mode 100644 index 000000000000..5d113fb788c9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/RemoteSupportSettings.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// RemoteApplicationType for which remote support settings is being modified + [System.ComponentModel.TypeConverter(typeof(RemoteSupportSettingsTypeConverter))] + public partial class RemoteSupportSettings + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RemoteSupportSettings(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.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RemoteSupportSettings(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.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RemoteSupportSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RemoteApplicationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettingsInternal)this).RemoteApplicationType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RemoteApplicationType?) content.GetValueForProperty("RemoteApplicationType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettingsInternal)this).RemoteApplicationType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RemoteApplicationType.CreateFrom); + } + if (content.Contains("AccessLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettingsInternal)this).AccessLevel = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccessLevel?) content.GetValueForProperty("AccessLevel",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettingsInternal)this).AccessLevel, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccessLevel.CreateFrom); + } + if (content.Contains("ExpirationTimeStampInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettingsInternal)this).ExpirationTimeStampInUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeStampInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettingsInternal)this).ExpirationTimeStampInUtc, (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 RemoteSupportSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RemoteApplicationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettingsInternal)this).RemoteApplicationType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RemoteApplicationType?) content.GetValueForProperty("RemoteApplicationType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettingsInternal)this).RemoteApplicationType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RemoteApplicationType.CreateFrom); + } + if (content.Contains("AccessLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettingsInternal)this).AccessLevel = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccessLevel?) content.GetValueForProperty("AccessLevel",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettingsInternal)this).AccessLevel, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccessLevel.CreateFrom); + } + if (content.Contains("ExpirationTimeStampInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettingsInternal)this).ExpirationTimeStampInUtc = (global::System.DateTime?) content.GetValueForProperty("ExpirationTimeStampInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettingsInternal)this).ExpirationTimeStampInUtc, (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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// RemoteApplicationType for which remote support settings is being modified + [System.ComponentModel.TypeConverter(typeof(RemoteSupportSettingsTypeConverter))] + public partial interface IRemoteSupportSettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/RemoteSupportSettings.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RemoteSupportSettings.TypeConverter.cs new file mode 100644 index 000000000000..1cd258f92ac2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/RemoteSupportSettings.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RemoteSupportSettingsTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RemoteSupportSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RemoteSupportSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RemoteSupportSettings.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/databoxedge/generated/api/Models/Api20220301/RemoteSupportSettings.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RemoteSupportSettings.cs new file mode 100644 index 000000000000..7d530769d79b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/RemoteSupportSettings.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// RemoteApplicationType for which remote support settings is being modified + public partial class RemoteSupportSettings : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettingsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccessLevel? _accessLevel; + + /// Access level allowed for this remote application type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccessLevel? AccessLevel { get => this._accessLevel; set => this._accessLevel = value; } + + /// Backing field for property. + private global::System.DateTime? _expirationTimeStampInUtc; + + /// Expiration time stamp + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? ExpirationTimeStampInUtc { get => this._expirationTimeStampInUtc; set => this._expirationTimeStampInUtc = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RemoteApplicationType? _remoteApplicationType; + + /// Remote application type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RemoteApplicationType? RemoteApplicationType { get => this._remoteApplicationType; set => this._remoteApplicationType = value; } + + /// Creates an new instance. + public RemoteSupportSettings() + { + + } + } + /// RemoteApplicationType for which remote support settings is being modified + public partial interface IRemoteSupportSettings : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Access level allowed for this remote application type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access level allowed for this remote application type", + SerializedName = @"accessLevel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccessLevel) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccessLevel? AccessLevel { get; set; } + /// Expiration time stamp + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiration time stamp", + SerializedName = @"expirationTimeStampInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationTimeStampInUtc { get; set; } + /// Remote application type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Remote application type", + SerializedName = @"remoteApplicationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RemoteApplicationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RemoteApplicationType? RemoteApplicationType { get; set; } + + } + /// RemoteApplicationType for which remote support settings is being modified + internal partial interface IRemoteSupportSettingsInternal + + { + /// Access level allowed for this remote application type + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccessLevel? AccessLevel { get; set; } + /// Expiration time stamp + global::System.DateTime? ExpirationTimeStampInUtc { get; set; } + /// Remote application type + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RemoteApplicationType? RemoteApplicationType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/RemoteSupportSettings.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RemoteSupportSettings.json.cs new file mode 100644 index 000000000000..597b0325ecc0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/RemoteSupportSettings.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// RemoteApplicationType for which remote support settings is being modified + public partial class RemoteSupportSettings + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRemoteSupportSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new RemoteSupportSettings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal RemoteSupportSettings(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_remoteApplicationType = If( json?.PropertyT("remoteApplicationType"), out var __jsonRemoteApplicationType) ? (string)__jsonRemoteApplicationType : (string)RemoteApplicationType;} + {_accessLevel = If( json?.PropertyT("accessLevel"), out var __jsonAccessLevel) ? (string)__jsonAccessLevel : (string)AccessLevel;} + {_expirationTimeStampInUtc = If( json?.PropertyT("expirationTimeStampInUTC"), out var __jsonExpirationTimeStampInUtc) ? global::System.DateTime.TryParse((string)__jsonExpirationTimeStampInUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationTimeStampInUtcValue) ? __jsonExpirationTimeStampInUtcValue : ExpirationTimeStampInUtc : ExpirationTimeStampInUtc;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._remoteApplicationType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._remoteApplicationType.ToString()) : null, "remoteApplicationType" ,container.Add ); + AddIf( null != (((object)this._accessLevel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._accessLevel.ToString()) : null, "accessLevel" ,container.Add ); + AddIf( null != this._expirationTimeStampInUtc ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._expirationTimeStampInUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "expirationTimeStampInUTC" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceIdentity.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceIdentity.PowerShell.cs new file mode 100644 index 000000000000..a4658f7dea2d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceIdentity.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Msi identity details of the resource + [System.ComponentModel.TypeConverter(typeof(ResourceIdentityTypeConverter))] + public partial class ResourceIdentity + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IResourceIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceIdentity(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.DataBoxEdge.Models.Api20220301.IResourceIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceIdentity(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.DataBoxEdge.Models.Api20220301.IResourceIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ResourceIdentity(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.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType.CreateFrom); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)this).TenantId, 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 ResourceIdentity(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.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType.CreateFrom); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal)this).TenantId, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Msi identity details of the resource + [System.ComponentModel.TypeConverter(typeof(ResourceIdentityTypeConverter))] + public partial interface IResourceIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceIdentity.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceIdentity.TypeConverter.cs new file mode 100644 index 000000000000..e3a483af1993 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceIdentity.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceIdentityTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IResourceIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceIdentity.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/databoxedge/generated/api/Models/Api20220301/ResourceIdentity.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceIdentity.cs new file mode 100644 index 000000000000..2fe47ad3d307 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceIdentity.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Msi identity details of the resource + public partial class ResourceIdentity : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentity, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal + { + + /// Internal Acessors for PrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + + /// Internal Acessors for TenantId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentityInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } + + /// Backing field for property. + private string _principalId; + + /// Service Principal Id backing the Msi + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string PrincipalId { get => this._principalId; } + + /// Backing field for property. + private string _tenantId; + + /// Home Tenant Id + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string TenantId { get => this._tenantId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType? _type; + + /// Identity type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public ResourceIdentity() + { + + } + } + /// Msi identity details of the resource + public partial interface IResourceIdentity : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Service Principal Id backing the Msi + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Service Principal Id backing the Msi", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string PrincipalId { get; } + /// Home Tenant Id + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Home Tenant Id", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; } + /// Identity type + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identity type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType? Type { get; set; } + + } + /// Msi identity details of the resource + internal partial interface IResourceIdentityInternal + + { + /// Service Principal Id backing the Msi + string PrincipalId { get; set; } + /// Home Tenant Id + string TenantId { get; set; } + /// Identity type + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceIdentity.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceIdentity.json.cs new file mode 100644 index 000000000000..e67967016f3b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceIdentity.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Msi identity details of the resource + public partial class ResourceIdentity + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ResourceIdentity(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceIdentity(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} + {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceMoveDetails.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceMoveDetails.PowerShell.cs new file mode 100644 index 000000000000..5a1ecfca424e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceMoveDetails.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Fields for tracking resource move + [System.ComponentModel.TypeConverter(typeof(ResourceMoveDetailsTypeConverter))] + public partial class ResourceMoveDetails + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IResourceMoveDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceMoveDetails(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.DataBoxEdge.Models.Api20220301.IResourceMoveDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceMoveDetails(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.DataBoxEdge.Models.Api20220301.IResourceMoveDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ResourceMoveDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OperationInProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetailsInternal)this).OperationInProgress = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus?) content.GetValueForProperty("OperationInProgress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetailsInternal)this).OperationInProgress, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus.CreateFrom); + } + if (content.Contains("OperationInProgressLockTimeoutInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetailsInternal)this).OperationInProgressLockTimeoutInUtc = (global::System.DateTime?) content.GetValueForProperty("OperationInProgressLockTimeoutInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetailsInternal)this).OperationInProgressLockTimeoutInUtc, (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 ResourceMoveDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OperationInProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetailsInternal)this).OperationInProgress = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus?) content.GetValueForProperty("OperationInProgress",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetailsInternal)this).OperationInProgress, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus.CreateFrom); + } + if (content.Contains("OperationInProgressLockTimeoutInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetailsInternal)this).OperationInProgressLockTimeoutInUtc = (global::System.DateTime?) content.GetValueForProperty("OperationInProgressLockTimeoutInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetailsInternal)this).OperationInProgressLockTimeoutInUtc, (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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Fields for tracking resource move + [System.ComponentModel.TypeConverter(typeof(ResourceMoveDetailsTypeConverter))] + public partial interface IResourceMoveDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceMoveDetails.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceMoveDetails.TypeConverter.cs new file mode 100644 index 000000000000..053e7e8af2f9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceMoveDetails.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceMoveDetailsTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IResourceMoveDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceMoveDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceMoveDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceMoveDetails.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/databoxedge/generated/api/Models/Api20220301/ResourceMoveDetails.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceMoveDetails.cs new file mode 100644 index 000000000000..8717092cdfcc --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceMoveDetails.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Fields for tracking resource move + public partial class ResourceMoveDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetails, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetailsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus? _operationInProgress; + + /// Denotes whether move operation is in progress + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus? OperationInProgress { get => this._operationInProgress; set => this._operationInProgress = value; } + + /// Backing field for property. + private global::System.DateTime? _operationInProgressLockTimeoutInUtc; + + /// Denotes the timeout of the operation to finish + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? OperationInProgressLockTimeoutInUtc { get => this._operationInProgressLockTimeoutInUtc; set => this._operationInProgressLockTimeoutInUtc = value; } + + /// Creates an new instance. + public ResourceMoveDetails() + { + + } + } + /// Fields for tracking resource move + public partial interface IResourceMoveDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Denotes whether move operation is in progress + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Denotes whether move operation is in progress", + SerializedName = @"operationInProgress", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus? OperationInProgress { get; set; } + /// Denotes the timeout of the operation to finish + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Denotes the timeout of the operation to finish", + SerializedName = @"operationInProgressLockTimeoutInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? OperationInProgressLockTimeoutInUtc { get; set; } + + } + /// Fields for tracking resource move + internal partial interface IResourceMoveDetailsInternal + + { + /// Denotes whether move operation is in progress + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus? OperationInProgress { get; set; } + /// Denotes the timeout of the operation to finish + global::System.DateTime? OperationInProgressLockTimeoutInUtc { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceMoveDetails.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceMoveDetails.json.cs new file mode 100644 index 000000000000..95f61e3d6ba7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ResourceMoveDetails.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Fields for tracking resource move + public partial class ResourceMoveDetails + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IResourceMoveDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ResourceMoveDetails(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceMoveDetails(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_operationInProgress = If( json?.PropertyT("operationInProgress"), out var __jsonOperationInProgress) ? (string)__jsonOperationInProgress : (string)OperationInProgress;} + {_operationInProgressLockTimeoutInUtc = If( json?.PropertyT("operationInProgressLockTimeoutInUTC"), out var __jsonOperationInProgressLockTimeoutInUtc) ? global::System.DateTime.TryParse((string)__jsonOperationInProgressLockTimeoutInUtc, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOperationInProgressLockTimeoutInUtcValue) ? __jsonOperationInProgressLockTimeoutInUtcValue : OperationInProgressLockTimeoutInUtc : OperationInProgressLockTimeoutInUtc;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._operationInProgress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._operationInProgress.ToString()) : null, "operationInProgress" ,container.Add ); + AddIf( null != this._operationInProgressLockTimeoutInUtc ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._operationInProgressLockTimeoutInUtc?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "operationInProgressLockTimeoutInUTC" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Role.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Role.PowerShell.cs new file mode 100644 index 000000000000..bdb9b6ed3fd2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Role.PowerShell.cs @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Compute role. + [System.ComponentModel.TypeConverter(typeof(RoleTypeConverter))] + public partial class Role + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IRole DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Role(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.DataBoxEdge.Models.Api20220301.IRole DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Role(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.DataBoxEdge.Models.Api20220301.IRole FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Role(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt, (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 Role(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal)this).SystemDataLastModifiedAt, (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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Compute role. + [System.ComponentModel.TypeConverter(typeof(RoleTypeConverter))] + public partial interface IRole + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Role.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Role.TypeConverter.cs new file mode 100644 index 000000000000..318d691f120a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Role.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RoleTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IRole ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Role.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Role.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Role.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/databoxedge/generated/api/Models/Api20220301/Role.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Role.cs new file mode 100644 index 000000000000..f9960a6f8f43 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Role.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Compute role. + public partial class Role : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes _kind; + + /// Role type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes Kind { get => this._kind; set => this._kind = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of Role + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Creates an new instance. + public Role() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// Compute role. + public partial interface IRole : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// Role type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Role type.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes Kind { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// Compute role. + internal partial interface IRoleInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// Role type. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes Kind { get; set; } + /// Metadata pertaining to creation and last modification of Role + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Role.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Role.json.cs new file mode 100644 index 000000000000..1d6c0bd76fa4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Role.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Compute role. + public partial class Role + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole interface is polymorphic, and the precise + /// model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("kind") ) + { + case "CloudEdgeManagement": + { + return new CloudEdgeManagementRole(json); + } + case "IOT": + { + return new IoTRole(json); + } + case "Kubernetes": + { + return new KubernetesRole(json); + } + case "MEC": + { + return new MecRole(json); + } + } + return new Role(json); + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal Role(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleList.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleList.PowerShell.cs new file mode 100644 index 000000000000..6bd360355bae --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Collection of all the roles on the Data Box Edge device. + [System.ComponentModel.TypeConverter(typeof(RoleListTypeConverter))] + public partial class RoleList + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IRoleList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleList(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.DataBoxEdge.Models.Api20220301.IRoleList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleList(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.DataBoxEdge.Models.Api20220301.IRoleList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleList(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.DataBoxEdge.Models.Api20220301.IRoleListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleListInternal)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 RoleList(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.DataBoxEdge.Models.Api20220301.IRoleListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RoleTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleListInternal)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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of all the roles on the Data Box Edge device. + [System.ComponentModel.TypeConverter(typeof(RoleListTypeConverter))] + public partial interface IRoleList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleList.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleList.TypeConverter.cs new file mode 100644 index 000000000000..b1549d3d0008 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RoleListTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IRoleList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RoleList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RoleList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RoleList.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/databoxedge/generated/api/Models/Api20220301/RoleList.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleList.cs new file mode 100644 index 000000000000..cdd20f50dca5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleList.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Collection of all the roles on the Data Box Edge device. + public partial class RoleList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleList, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleListInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole[] _value; + + /// The Value. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole[] Value { get => this._value; } + + /// Creates an new instance. + public RoleList() + { + + } + } + /// Collection of all the roles on the Data Box Edge device. + public partial interface IRoleList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Link to the next set of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The Value. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole[] Value { get; } + + } + /// Collection of all the roles on the Data Box Edge device. + internal partial interface IRoleListInternal + + { + /// Link to the next set of results. + string NextLink { get; set; } + /// The Value. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleList.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleList.json.cs new file mode 100644 index 000000000000..919fdb8983bd --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleList.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Collection of all the roles on the Data Box Edge device. + public partial class RoleList + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new RoleList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal RoleList(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IRole) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Role.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/RoleSinkInfo.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleSinkInfo.PowerShell.cs new file mode 100644 index 000000000000..e909a94cc6c8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleSinkInfo.PowerShell.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Compute role against which events will be raised. + [System.ComponentModel.TypeConverter(typeof(RoleSinkInfoTypeConverter))] + public partial class RoleSinkInfo + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IRoleSinkInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleSinkInfo(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.DataBoxEdge.Models.Api20220301.IRoleSinkInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleSinkInfo(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.DataBoxEdge.Models.Api20220301.IRoleSinkInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleSinkInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RoleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfoInternal)this).RoleId = (string) content.GetValueForProperty("RoleId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfoInternal)this).RoleId, 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 RoleSinkInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RoleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfoInternal)this).RoleId = (string) content.GetValueForProperty("RoleId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfoInternal)this).RoleId, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Compute role against which events will be raised. + [System.ComponentModel.TypeConverter(typeof(RoleSinkInfoTypeConverter))] + public partial interface IRoleSinkInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleSinkInfo.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleSinkInfo.TypeConverter.cs new file mode 100644 index 000000000000..603534bb7deb --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleSinkInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RoleSinkInfoTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IRoleSinkInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RoleSinkInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RoleSinkInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RoleSinkInfo.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/databoxedge/generated/api/Models/Api20220301/RoleSinkInfo.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleSinkInfo.cs new file mode 100644 index 000000000000..6a7fdf8097c5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleSinkInfo.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Compute role against which events will be raised. + public partial class RoleSinkInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfoInternal + { + + /// Backing field for property. + private string _roleId; + + /// Compute role ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string RoleId { get => this._roleId; set => this._roleId = value; } + + /// Creates an new instance. + public RoleSinkInfo() + { + + } + } + /// Compute role against which events will be raised. + public partial interface IRoleSinkInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Compute role ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Compute role ID.", + SerializedName = @"roleId", + PossibleTypes = new [] { typeof(string) })] + string RoleId { get; set; } + + } + /// Compute role against which events will be raised. + internal partial interface IRoleSinkInfoInternal + + { + /// Compute role ID. + string RoleId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleSinkInfo.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleSinkInfo.json.cs new file mode 100644 index 000000000000..5e3234c650a3 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/RoleSinkInfo.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Compute role against which events will be raised. + public partial class RoleSinkInfo + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRoleSinkInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new RoleSinkInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal RoleSinkInfo(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_roleId = If( json?.PropertyT("roleId"), out var __jsonRoleId) ? (string)__jsonRoleId : (string)RoleId;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._roleId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._roleId.ToString()) : null, "roleId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Secret.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Secret.PowerShell.cs new file mode 100644 index 000000000000..1576343bb47a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Secret.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Holds device secret either as a KeyVault reference or as an encrypted value. + [System.ComponentModel.TypeConverter(typeof(SecretTypeConverter))] + public partial class Secret + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.ISecret DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Secret(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.DataBoxEdge.Models.Api20220301.ISecret DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Secret(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.DataBoxEdge.Models.Api20220301.ISecret FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Secret(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EncryptedSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).EncryptedSecret = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("EncryptedSecret",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).EncryptedSecret, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("KeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).KeyVaultId = (string) content.GetValueForProperty("KeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).KeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("EncryptedSecretEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).EncryptedSecretEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("EncryptedSecretEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).EncryptedSecretEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("EncryptedSecretValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).EncryptedSecretValue = (string) content.GetValueForProperty("EncryptedSecretValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).EncryptedSecretValue, global::System.Convert.ToString); + } + if (content.Contains("EncryptedSecretEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).EncryptedSecretEncryptionCertThumbprint = (string) content.GetValueForProperty("EncryptedSecretEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).EncryptedSecretEncryptionCertThumbprint, 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 Secret(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EncryptedSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).EncryptedSecret = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("EncryptedSecret",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).EncryptedSecret, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("KeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).KeyVaultId = (string) content.GetValueForProperty("KeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).KeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("EncryptedSecretEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).EncryptedSecretEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("EncryptedSecretEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).EncryptedSecretEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("EncryptedSecretValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).EncryptedSecretValue = (string) content.GetValueForProperty("EncryptedSecretValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).EncryptedSecretValue, global::System.Convert.ToString); + } + if (content.Contains("EncryptedSecretEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).EncryptedSecretEncryptionCertThumbprint = (string) content.GetValueForProperty("EncryptedSecretEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal)this).EncryptedSecretEncryptionCertThumbprint, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Holds device secret either as a KeyVault reference or as an encrypted value. + [System.ComponentModel.TypeConverter(typeof(SecretTypeConverter))] + public partial interface ISecret + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Secret.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Secret.TypeConverter.cs new file mode 100644 index 000000000000..d43b698123fb --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Secret.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SecretTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ISecret ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecret).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Secret.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Secret.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Secret.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/databoxedge/generated/api/Models/Api20220301/Secret.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Secret.cs new file mode 100644 index 000000000000..7ae4af92495e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Secret.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Holds device secret either as a KeyVault reference or as an encrypted value. + public partial class Secret : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecret, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret _encryptedSecret; + + /// Encrypted (using device public key) secret value. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret EncryptedSecret { get => (this._encryptedSecret = this._encryptedSecret ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret()); set => this._encryptedSecret = value; } + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? EncryptedSecretEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)EncryptedSecret).EncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)EncryptedSecret).EncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string EncryptedSecretEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)EncryptedSecret).EncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)EncryptedSecret).EncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string EncryptedSecretValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)EncryptedSecret).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)EncryptedSecret).Value = value ?? null; } + + /// Backing field for property. + private string _keyVaultId; + + /// + /// Id of the Key-Vault where secret is stored (ex: secrets/AuthClientSecret/82ef4346187a4033a10d629cde07d740). + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string KeyVaultId { get => this._keyVaultId; set => this._keyVaultId = value; } + + /// Internal Acessors for EncryptedSecret + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecretInternal.EncryptedSecret { get => (this._encryptedSecret = this._encryptedSecret ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret()); set { {_encryptedSecret = value;} } } + + /// Creates an new instance. + public Secret() + { + + } + } + /// Holds device secret either as a KeyVault reference or as an encrypted value. + public partial interface ISecret : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? EncryptedSecretEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string EncryptedSecretEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string EncryptedSecretValue { get; set; } + /// + /// Id of the Key-Vault where secret is stored (ex: secrets/AuthClientSecret/82ef4346187a4033a10d629cde07d740). + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id of the Key-Vault where secret is stored (ex: secrets/AuthClientSecret/82ef4346187a4033a10d629cde07d740).", + SerializedName = @"keyVaultId", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultId { get; set; } + + } + /// Holds device secret either as a KeyVault reference or as an encrypted value. + internal partial interface ISecretInternal + + { + /// Encrypted (using device public key) secret value. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret EncryptedSecret { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? EncryptedSecretEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string EncryptedSecretEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string EncryptedSecretValue { get; set; } + /// + /// Id of the Key-Vault where secret is stored (ex: secrets/AuthClientSecret/82ef4346187a4033a10d629cde07d740). + /// + string KeyVaultId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Secret.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Secret.json.cs new file mode 100644 index 000000000000..26ef8c3027a9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Secret.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Holds device secret either as a KeyVault reference or as an encrypted value. + public partial class Secret + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecret. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecret. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecret FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new Secret(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal Secret(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_encryptedSecret = If( json?.PropertyT("encryptedSecret"), out var __jsonEncryptedSecret) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret.FromJson(__jsonEncryptedSecret) : EncryptedSecret;} + {_keyVaultId = If( json?.PropertyT("keyVaultId"), out var __jsonKeyVaultId) ? (string)__jsonKeyVaultId : (string)KeyVaultId;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._encryptedSecret ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._encryptedSecret.ToJson(null,serializationMode) : null, "encryptedSecret" ,container.Add ); + AddIf( null != (((object)this._keyVaultId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._keyVaultId.ToString()) : null, "keyVaultId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SecuritySettings.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SecuritySettings.PowerShell.cs new file mode 100644 index 000000000000..7957fc88d82d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SecuritySettings.PowerShell.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The security settings 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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.ISecuritySettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SecuritySettingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DeviceAdminPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).DeviceAdminPassword = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("DeviceAdminPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).DeviceAdminPassword, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("DeviceAdminPasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).DeviceAdminPasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("DeviceAdminPasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).DeviceAdminPasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("DeviceAdminPasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).DeviceAdminPasswordValue = (string) content.GetValueForProperty("DeviceAdminPasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).DeviceAdminPasswordValue, global::System.Convert.ToString); + } + if (content.Contains("DeviceAdminPasswordEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).DeviceAdminPasswordEncryptionCertThumbprint = (string) content.GetValueForProperty("DeviceAdminPasswordEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).DeviceAdminPasswordEncryptionCertThumbprint, 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.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SecuritySettingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DeviceAdminPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).DeviceAdminPassword = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("DeviceAdminPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).DeviceAdminPassword, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("DeviceAdminPasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).DeviceAdminPasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("DeviceAdminPasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).DeviceAdminPasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("DeviceAdminPasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).DeviceAdminPasswordValue = (string) content.GetValueForProperty("DeviceAdminPasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).DeviceAdminPasswordValue, global::System.Convert.ToString); + } + if (content.Contains("DeviceAdminPasswordEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).DeviceAdminPasswordEncryptionCertThumbprint = (string) content.GetValueForProperty("DeviceAdminPasswordEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal)this).DeviceAdminPasswordEncryptionCertThumbprint, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The security settings of a device. + [System.ComponentModel.TypeConverter(typeof(SecuritySettingsTypeConverter))] + public partial interface ISecuritySettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SecuritySettings.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SecuritySettings.TypeConverter.cs new file mode 100644 index 000000000000..68b9c90e1813 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ISecuritySettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/SecuritySettings.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SecuritySettings.cs new file mode 100644 index 000000000000..70a4f947a69c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SecuritySettings.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The security settings of a device. + public partial class SecuritySettings : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettings, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm DeviceAdminPasswordEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)Property).DeviceAdminPasswordEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)Property).DeviceAdminPasswordEncryptionAlgorithm = value ; } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string DeviceAdminPasswordEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)Property).DeviceAdminPasswordEncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)Property).DeviceAdminPasswordEncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string DeviceAdminPasswordValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)Property).DeviceAdminPasswordValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)Property).DeviceAdminPasswordValue = value ; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for DeviceAdminPassword + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal.DeviceAdminPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)Property).DeviceAdminPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)Property).DeviceAdminPassword = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SecuritySettingsProperties()); set { {_property = value;} } } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsProperties _property; + + /// Properties of the security settings. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SecuritySettingsProperties()); set => this._property = value; } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Creates an new instance. + public SecuritySettings() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// The security settings of a device. + public partial interface ISecuritySettings : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm DeviceAdminPasswordEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string DeviceAdminPasswordEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string DeviceAdminPasswordValue { get; set; } + + } + /// The security settings of a device. + internal partial interface ISecuritySettingsInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// + /// Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to sign into the local web + /// UI of the device. The Actual password should have at least 8 characters that are a combination of uppercase, lowercase, + /// numeric, and special characters. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret DeviceAdminPassword { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm DeviceAdminPasswordEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string DeviceAdminPasswordEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string DeviceAdminPasswordValue { get; set; } + /// Properties of the security settings. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SecuritySettings.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SecuritySettings.json.cs new file mode 100644 index 000000000000..dda8d03f7beb --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SecuritySettings.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The security settings 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new SecuritySettings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal SecuritySettings(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/SecuritySettingsProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SecuritySettingsProperties.PowerShell.cs new file mode 100644 index 000000000000..b147bfa894df --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SecuritySettingsProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The properties of security settings. + [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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.ISecuritySettingsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)this).DeviceAdminPassword = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("DeviceAdminPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)this).DeviceAdminPassword, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("DeviceAdminPasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("DeviceAdminPasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("DeviceAdminPasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordValue = (string) content.GetValueForProperty("DeviceAdminPasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordValue, global::System.Convert.ToString); + } + if (content.Contains("DeviceAdminPasswordEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordEncryptionCertThumbprint = (string) content.GetValueForProperty("DeviceAdminPasswordEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordEncryptionCertThumbprint, 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.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)this).DeviceAdminPassword = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("DeviceAdminPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)this).DeviceAdminPassword, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("DeviceAdminPasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("DeviceAdminPasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("DeviceAdminPasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordValue = (string) content.GetValueForProperty("DeviceAdminPasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordValue, global::System.Convert.ToString); + } + if (content.Contains("DeviceAdminPasswordEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordEncryptionCertThumbprint = (string) content.GetValueForProperty("DeviceAdminPasswordEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordEncryptionCertThumbprint, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of security settings. + [System.ComponentModel.TypeConverter(typeof(SecuritySettingsPropertiesTypeConverter))] + public partial interface ISecuritySettingsProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SecuritySettingsProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SecuritySettingsProperties.TypeConverter.cs new file mode 100644 index 000000000000..fd85e3c59c5b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ISecuritySettingsProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/SecuritySettingsProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SecuritySettingsProperties.cs new file mode 100644 index 000000000000..9cbedce06d81 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SecuritySettingsProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The properties of security settings. + public partial class SecuritySettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret _deviceAdminPassword; + + /// + /// Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to sign into the local web + /// UI of the device. The Actual password should have at least 8 characters that are a combination of uppercase, lowercase, + /// numeric, and special characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret DeviceAdminPassword { get => (this._deviceAdminPassword = this._deviceAdminPassword ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret()); set => this._deviceAdminPassword = value; } + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm DeviceAdminPasswordEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)DeviceAdminPassword).EncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)DeviceAdminPassword).EncryptionAlgorithm = value ; } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string DeviceAdminPasswordEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)DeviceAdminPassword).EncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)DeviceAdminPassword).EncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string DeviceAdminPasswordValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)DeviceAdminPassword).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)DeviceAdminPassword).Value = value ; } + + /// Internal Acessors for DeviceAdminPassword + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsPropertiesInternal.DeviceAdminPassword { get => (this._deviceAdminPassword = this._deviceAdminPassword ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret()); set { {_deviceAdminPassword = value;} } } + + /// Creates an new instance. + public SecuritySettingsProperties() + { + + } + } + /// The properties of security settings. + public partial interface ISecuritySettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm DeviceAdminPasswordEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string DeviceAdminPasswordEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string DeviceAdminPasswordValue { get; set; } + + } + /// The properties of security settings. + internal partial interface ISecuritySettingsPropertiesInternal + + { + /// + /// Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to sign into the local web + /// UI of the device. The Actual password should have at least 8 characters that are a combination of uppercase, lowercase, + /// numeric, and special characters. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret DeviceAdminPassword { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm DeviceAdminPasswordEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string DeviceAdminPasswordEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string DeviceAdminPasswordValue { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SecuritySettingsProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SecuritySettingsProperties.json.cs new file mode 100644 index 000000000000..5751b7d5109b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SecuritySettingsProperties.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The properties of security settings. + 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettingsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new SecuritySettingsProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal SecuritySettingsProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._deviceAdminPassword ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/ServiceSpecification.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ServiceSpecification.PowerShell.cs new file mode 100644 index 000000000000..08151b9b62f5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ServiceSpecification.PowerShell.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Service specification. + [System.ComponentModel.TypeConverter(typeof(ServiceSpecificationTypeConverter))] + public partial class ServiceSpecification + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IServiceSpecification DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ServiceSpecification(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.DataBoxEdge.Models.Api20220301.IServiceSpecification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ServiceSpecification(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.DataBoxEdge.Models.Api20220301.IServiceSpecification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ServiceSpecification(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MetricSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecificationInternal)this).MetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1[]) content.GetValueForProperty("MetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecificationInternal)this).MetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricSpecificationV1TypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ServiceSpecification(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MetricSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecificationInternal)this).MetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1[]) content.GetValueForProperty("MetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecificationInternal)this).MetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricSpecificationV1TypeConverter.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Service specification. + [System.ComponentModel.TypeConverter(typeof(ServiceSpecificationTypeConverter))] + public partial interface IServiceSpecification + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ServiceSpecification.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ServiceSpecification.TypeConverter.cs new file mode 100644 index 000000000000..3dae7c413696 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ServiceSpecification.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ServiceSpecificationTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IServiceSpecification ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecification).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ServiceSpecification.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ServiceSpecification.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ServiceSpecification.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/databoxedge/generated/api/Models/Api20220301/ServiceSpecification.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ServiceSpecification.cs new file mode 100644 index 000000000000..746ed7c3ff25 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ServiceSpecification.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Service specification. + public partial class ServiceSpecification : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecification, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecificationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1[] _metricSpecification; + + /// Metric specification as defined by shoebox. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1[] MetricSpecification { get => this._metricSpecification; set => this._metricSpecification = value; } + + /// Creates an new instance. + public ServiceSpecification() + { + + } + } + /// Service specification. + public partial interface IServiceSpecification : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Metric specification as defined by shoebox. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Metric specification as defined by shoebox.", + SerializedName = @"metricSpecifications", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1[] MetricSpecification { get; set; } + + } + /// Service specification. + internal partial interface IServiceSpecificationInternal + + { + /// Metric specification as defined by shoebox. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1[] MetricSpecification { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ServiceSpecification.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ServiceSpecification.json.cs new file mode 100644 index 000000000000..2c0a8e8ad98c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ServiceSpecification.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Service specification. + public partial class ServiceSpecification + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecification. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecification. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IServiceSpecification FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ServiceSpecification(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ServiceSpecification(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_metricSpecification = If( json?.PropertyT("metricSpecifications"), out var __jsonMetricSpecifications) ? If( __jsonMetricSpecifications as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IMetricSpecificationV1) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MetricSpecificationV1.FromJson(__u) )) ))() : null : MetricSpecification;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._metricSpecification) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._metricSpecification ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("metricSpecifications",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Share.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Share.PowerShell.cs new file mode 100644 index 000000000000..4ad09a80169a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Share.PowerShell.cs @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Represents a share on the Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(ShareTypeConverter))] + public partial class Share + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IShare DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Share(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.DataBoxEdge.Models.Api20220301.IShare DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Share(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.DataBoxEdge.Models.Api20220301.IShare FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Share(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.DataBoxEdge.Models.Api20220301.IShareInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SharePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("RefreshDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails) content.GetValueForProperty("RefreshDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RefreshDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus.CreateFrom); + } + if (content.Contains("MonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus.CreateFrom); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy?) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy.CreateFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AzureContainerInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AzureContainerInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfo) content.GetValueForProperty("AzureContainerInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AzureContainerInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AzureContainerInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("AccessProtocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AccessProtocol = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol) content.GetValueForProperty("AccessProtocol",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AccessProtocol, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol.CreateFrom); + } + if (content.Contains("UserAccessRights")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).UserAccessRights = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight[]) content.GetValueForProperty("UserAccessRights",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).UserAccessRights, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UserAccessRightTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientAccessRights")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).ClientAccessRights = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight[]) content.GetValueForProperty("ClientAccessRights",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).ClientAccessRights, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClientAccessRightTypeConverter.ConvertFrom)); + } + if (content.Contains("Mapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).Mapping = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[]) content.GetValueForProperty("Mapping",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).Mapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMapTypeConverter.ConvertFrom)); + } + if (content.Contains("AzureContainerInfoContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AzureContainerInfoContainerName = (string) content.GetValueForProperty("AzureContainerInfoContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AzureContainerInfoContainerName, global::System.Convert.ToString); + } + if (content.Contains("RefreshDetailLastJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetailLastJob = (string) content.GetValueForProperty("RefreshDetailLastJob",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetailLastJob, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AzureContainerInfoStorageAccountCredentialId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AzureContainerInfoStorageAccountCredentialId = (string) content.GetValueForProperty("AzureContainerInfoStorageAccountCredentialId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AzureContainerInfoStorageAccountCredentialId, global::System.Convert.ToString); + } + if (content.Contains("AzureContainerInfoDataFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AzureContainerInfoDataFormat = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat) content.GetValueForProperty("AzureContainerInfoDataFormat",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AzureContainerInfoDataFormat, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat.CreateFrom); + } + if (content.Contains("RefreshDetailInProgressRefreshJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetailInProgressRefreshJobId = (string) content.GetValueForProperty("RefreshDetailInProgressRefreshJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetailInProgressRefreshJobId, global::System.Convert.ToString); + } + if (content.Contains("RefreshDetailLastCompletedRefreshJobTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetailLastCompletedRefreshJobTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RefreshDetailLastCompletedRefreshJobTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetailLastCompletedRefreshJobTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RefreshDetailErrorManifestFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetailErrorManifestFile = (string) content.GetValueForProperty("RefreshDetailErrorManifestFile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetailErrorManifestFile, 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 Share(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.DataBoxEdge.Models.Api20220301.IShareInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SharePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("RefreshDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails) content.GetValueForProperty("RefreshDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RefreshDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus.CreateFrom); + } + if (content.Contains("MonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus.CreateFrom); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy?) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy.CreateFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AzureContainerInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AzureContainerInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfo) content.GetValueForProperty("AzureContainerInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AzureContainerInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AzureContainerInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("AccessProtocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AccessProtocol = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol) content.GetValueForProperty("AccessProtocol",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AccessProtocol, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol.CreateFrom); + } + if (content.Contains("UserAccessRights")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).UserAccessRights = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight[]) content.GetValueForProperty("UserAccessRights",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).UserAccessRights, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UserAccessRightTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientAccessRights")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).ClientAccessRights = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight[]) content.GetValueForProperty("ClientAccessRights",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).ClientAccessRights, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClientAccessRightTypeConverter.ConvertFrom)); + } + if (content.Contains("Mapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).Mapping = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[]) content.GetValueForProperty("Mapping",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).Mapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMapTypeConverter.ConvertFrom)); + } + if (content.Contains("AzureContainerInfoContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AzureContainerInfoContainerName = (string) content.GetValueForProperty("AzureContainerInfoContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AzureContainerInfoContainerName, global::System.Convert.ToString); + } + if (content.Contains("RefreshDetailLastJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetailLastJob = (string) content.GetValueForProperty("RefreshDetailLastJob",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetailLastJob, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AzureContainerInfoStorageAccountCredentialId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AzureContainerInfoStorageAccountCredentialId = (string) content.GetValueForProperty("AzureContainerInfoStorageAccountCredentialId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AzureContainerInfoStorageAccountCredentialId, global::System.Convert.ToString); + } + if (content.Contains("AzureContainerInfoDataFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AzureContainerInfoDataFormat = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat) content.GetValueForProperty("AzureContainerInfoDataFormat",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).AzureContainerInfoDataFormat, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat.CreateFrom); + } + if (content.Contains("RefreshDetailInProgressRefreshJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetailInProgressRefreshJobId = (string) content.GetValueForProperty("RefreshDetailInProgressRefreshJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetailInProgressRefreshJobId, global::System.Convert.ToString); + } + if (content.Contains("RefreshDetailLastCompletedRefreshJobTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetailLastCompletedRefreshJobTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RefreshDetailLastCompletedRefreshJobTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetailLastCompletedRefreshJobTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RefreshDetailErrorManifestFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetailErrorManifestFile = (string) content.GetValueForProperty("RefreshDetailErrorManifestFile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal)this).RefreshDetailErrorManifestFile, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Represents a share on the Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(ShareTypeConverter))] + public partial interface IShare + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Share.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Share.TypeConverter.cs new file mode 100644 index 000000000000..c5a3f3467194 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Share.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ShareTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IShare ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Share.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Share.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Share.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/databoxedge/generated/api/Models/Api20220301/Share.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Share.cs new file mode 100644 index 000000000000..7aaff1b528bd --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Share.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Represents a share on the Data Box Edge/Gateway device. + public partial class Share : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// Access protocol to be used by the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol AccessProtocol { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).AccessProtocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).AccessProtocol = value ; } + + /// + /// Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob). + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string AzureContainerInfoContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).AzureContainerInfoContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).AzureContainerInfoContainerName = value ?? null; } + + /// Storage format used for the file represented by the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat? AzureContainerInfoDataFormat { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).AzureContainerInfoDataFormat; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).AzureContainerInfoDataFormat = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat)""); } + + /// ID of the storage account credential used to access storage. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string AzureContainerInfoStorageAccountCredentialId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).AzureContainerInfoStorageAccountCredentialId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).AzureContainerInfoStorageAccountCredentialId = value ?? null; } + + /// + /// List of IP addresses and corresponding access rights on the share(required for NFS protocol). + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight[] ClientAccessRights { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).ClientAccessRights; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).ClientAccessRights = value ?? null /* arrayOf */; } + + /// Data policy of the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy? DataPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).DataPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).DataPolicy = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy)""); } + + /// Description for the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).Description = value ?? null; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// Share mount point to the role. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] Mapping { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).ShareMapping; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for AzureContainerInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal.AzureContainerInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).AzureContainerInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).AzureContainerInfo = value; } + + /// Internal Acessors for Mapping + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal.Mapping { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).ShareMapping; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).ShareMapping = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ShareProperties()); set { {_property = value;} } } + + /// Internal Acessors for RefreshDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal.RefreshDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).RefreshDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).RefreshDetail = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Current monitoring status of the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus MonitoringStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).MonitoringStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).MonitoringStatus = value ; } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareProperties _property; + + /// The share properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ShareProperties()); set => this._property = value; } + + /// + /// Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This + /// could be a failed job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string RefreshDetailErrorManifestFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).RefreshDetailErrorManifestFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).RefreshDetailErrorManifestFile = value ?? null; } + + /// + /// If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that + /// job. The field is empty if no job is in progress. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string RefreshDetailInProgressRefreshJobId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).RefreshDetailInProgressRefreshJobId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).RefreshDetailInProgressRefreshJobId = value ?? null; } + + /// + /// Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed + /// job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? RefreshDetailLastCompletedRefreshJobTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).RefreshDetailLastCompletedRefreshJobTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).RefreshDetailLastCompletedRefreshJobTimeInUtc = value ?? default(global::System.DateTime); } + + /// + /// Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a + /// successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string RefreshDetailLastJob { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).RefreshDetailLastJob; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).RefreshDetailLastJob = value ?? null; } + + /// Current status of the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).ShareStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).ShareStatus = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of Share + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// + /// Mapping of users and corresponding access rights on the share (required for SMB protocol). + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight[] UserAccessRights { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).UserAccessRights; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)Property).UserAccessRights = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public Share() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// Represents a share on the Data Box Edge/Gateway device. + public partial interface IShare : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// Access protocol to be used by the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Access protocol to be used by the share.", + SerializedName = @"accessProtocol", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol AccessProtocol { get; set; } + /// + /// Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob). + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob).", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + string AzureContainerInfoContainerName { get; set; } + /// Storage format used for the file represented by the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage format used for the file represented by the share.", + SerializedName = @"dataFormat", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat? AzureContainerInfoDataFormat { get; set; } + /// ID of the storage account credential used to access storage. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the storage account credential used to access storage.", + SerializedName = @"storageAccountCredentialId", + PossibleTypes = new [] { typeof(string) })] + string AzureContainerInfoStorageAccountCredentialId { get; set; } + /// + /// List of IP addresses and corresponding access rights on the share(required for NFS protocol). + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of IP addresses and corresponding access rights on the share(required for NFS protocol).", + SerializedName = @"clientAccessRights", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight[] ClientAccessRights { get; set; } + /// Data policy of the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data policy of the share.", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy? DataPolicy { get; set; } + /// Description for the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description for the share.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Share mount point to the role. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Share mount point to the role.", + SerializedName = @"shareMappings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] Mapping { get; } + /// Current monitoring status of the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Current monitoring status of the share.", + SerializedName = @"monitoringStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus MonitoringStatus { get; set; } + /// + /// Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This + /// could be a failed job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This could be a failed job or a successful job.", + SerializedName = @"errorManifestFile", + PossibleTypes = new [] { typeof(string) })] + string RefreshDetailErrorManifestFile { get; set; } + /// + /// If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that + /// job. The field is empty if no job is in progress. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that job. The field is empty if no job is in progress.", + SerializedName = @"inProgressRefreshJobId", + PossibleTypes = new [] { typeof(string) })] + string RefreshDetailInProgressRefreshJobId { get; set; } + /// + /// Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed + /// job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed job or a successful job.", + SerializedName = @"lastCompletedRefreshJobTimeInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RefreshDetailLastCompletedRefreshJobTimeInUtc { get; set; } + /// + /// Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a + /// successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a successful job.", + SerializedName = @"lastJob", + PossibleTypes = new [] { typeof(string) })] + string RefreshDetailLastJob { get; set; } + /// Current status of the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Current status of the share.", + SerializedName = @"shareStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus Status { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// + /// Mapping of users and corresponding access rights on the share (required for SMB protocol). + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mapping of users and corresponding access rights on the share (required for SMB protocol).", + SerializedName = @"userAccessRights", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight[] UserAccessRights { get; set; } + + } + /// Represents a share on the Data Box Edge/Gateway device. + internal partial interface IShareInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// Access protocol to be used by the share. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol AccessProtocol { get; set; } + /// Azure container mapping for the share. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfo AzureContainerInfo { get; set; } + /// + /// Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob). + /// + string AzureContainerInfoContainerName { get; set; } + /// Storage format used for the file represented by the share. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat? AzureContainerInfoDataFormat { get; set; } + /// ID of the storage account credential used to access storage. + string AzureContainerInfoStorageAccountCredentialId { get; set; } + /// + /// List of IP addresses and corresponding access rights on the share(required for NFS protocol). + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight[] ClientAccessRights { get; set; } + /// Data policy of the share. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy? DataPolicy { get; set; } + /// Description for the share. + string Description { get; set; } + /// Share mount point to the role. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] Mapping { get; set; } + /// Current monitoring status of the share. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus MonitoringStatus { get; set; } + /// The share properties. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareProperties Property { get; set; } + /// Details of the refresh job on this share. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails RefreshDetail { get; set; } + /// + /// Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This + /// could be a failed job or a successful job. + /// + string RefreshDetailErrorManifestFile { get; set; } + /// + /// If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that + /// job. The field is empty if no job is in progress. + /// + string RefreshDetailInProgressRefreshJobId { get; set; } + /// + /// Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed + /// job or a successful job. + /// + global::System.DateTime? RefreshDetailLastCompletedRefreshJobTimeInUtc { get; set; } + /// + /// Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a + /// successful job. + /// + string RefreshDetailLastJob { get; set; } + /// Current status of the share. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus Status { get; set; } + /// Metadata pertaining to creation and last modification of Share + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// + /// Mapping of users and corresponding access rights on the share (required for SMB protocol). + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight[] UserAccessRights { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Share.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Share.json.cs new file mode 100644 index 000000000000..ece7473b4965 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Share.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Represents a share on the Data Box Edge/Gateway device. + public partial class Share + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new Share(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal Share(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ShareProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareAccessRight.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareAccessRight.PowerShell.cs new file mode 100644 index 000000000000..56ec6b40f267 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareAccessRight.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// Specifies the mapping between this particular user and the type of access he has on shares on this device. + /// + [System.ComponentModel.TypeConverter(typeof(ShareAccessRightTypeConverter))] + public partial class ShareAccessRight + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IShareAccessRight DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ShareAccessRight(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.DataBoxEdge.Models.Api20220301.IShareAccessRight DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ShareAccessRight(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.DataBoxEdge.Models.Api20220301.IShareAccessRight FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ShareAccessRight(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ShareId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRightInternal)this).ShareId = (string) content.GetValueForProperty("ShareId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRightInternal)this).ShareId, global::System.Convert.ToString); + } + if (content.Contains("AccessType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRightInternal)this).AccessType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType) content.GetValueForProperty("AccessType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRightInternal)this).AccessType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ShareAccessRight(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ShareId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRightInternal)this).ShareId = (string) content.GetValueForProperty("ShareId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRightInternal)this).ShareId, global::System.Convert.ToString); + } + if (content.Contains("AccessType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRightInternal)this).AccessType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType) content.GetValueForProperty("AccessType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRightInternal)this).AccessType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Specifies the mapping between this particular user and the type of access he has on shares on this device. + [System.ComponentModel.TypeConverter(typeof(ShareAccessRightTypeConverter))] + public partial interface IShareAccessRight + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareAccessRight.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareAccessRight.TypeConverter.cs new file mode 100644 index 000000000000..23c568992422 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareAccessRight.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ShareAccessRightTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IShareAccessRight ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ShareAccessRight.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ShareAccessRight.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ShareAccessRight.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/databoxedge/generated/api/Models/Api20220301/ShareAccessRight.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareAccessRight.cs new file mode 100644 index 000000000000..6432b5c0df34 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareAccessRight.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// Specifies the mapping between this particular user and the type of access he has on shares on this device. + /// + public partial class ShareAccessRight : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRightInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType _accessType; + + /// Type of access to be allowed on the share for this user. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType AccessType { get => this._accessType; set => this._accessType = value; } + + /// Backing field for property. + private string _shareId; + + /// The share ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ShareId { get => this._shareId; set => this._shareId = value; } + + /// Creates an new instance. + public ShareAccessRight() + { + + } + } + /// Specifies the mapping between this particular user and the type of access he has on shares on this device. + public partial interface IShareAccessRight : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Type of access to be allowed on the share for this user. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of access to be allowed on the share for this user.", + SerializedName = @"accessType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType AccessType { get; set; } + /// The share ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The share ID.", + SerializedName = @"shareId", + PossibleTypes = new [] { typeof(string) })] + string ShareId { get; set; } + + } + /// Specifies the mapping between this particular user and the type of access he has on shares on this device. + internal partial interface IShareAccessRightInternal + + { + /// Type of access to be allowed on the share for this user. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType AccessType { get; set; } + /// The share ID. + string ShareId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareAccessRight.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareAccessRight.json.cs new file mode 100644 index 000000000000..7f7c8e76abc4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareAccessRight.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// Specifies the mapping between this particular user and the type of access he has on shares on this device. + /// + public partial class ShareAccessRight + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ShareAccessRight(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ShareAccessRight(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_shareId = If( json?.PropertyT("shareId"), out var __jsonShareId) ? (string)__jsonShareId : (string)ShareId;} + {_accessType = If( json?.PropertyT("accessType"), out var __jsonAccessType) ? (string)__jsonAccessType : (string)AccessType;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._shareId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._shareId.ToString()) : null, "shareId" ,container.Add ); + AddIf( null != (((object)this._accessType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._accessType.ToString()) : null, "accessType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareList.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareList.PowerShell.cs new file mode 100644 index 000000000000..ddec47aa8e7f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Collection of all the shares on the Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(ShareListTypeConverter))] + public partial class ShareList + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IShareList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ShareList(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.DataBoxEdge.Models.Api20220301.IShareList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ShareList(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.DataBoxEdge.Models.Api20220301.IShareList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ShareList(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.DataBoxEdge.Models.Api20220301.IShareListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ShareTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareListInternal)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 ShareList(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.DataBoxEdge.Models.Api20220301.IShareListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ShareTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareListInternal)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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of all the shares on the Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(ShareListTypeConverter))] + public partial interface IShareList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareList.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareList.TypeConverter.cs new file mode 100644 index 000000000000..832589e21252 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ShareListTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IShareList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ShareList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ShareList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ShareList.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/databoxedge/generated/api/Models/Api20220301/ShareList.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareList.cs new file mode 100644 index 000000000000..b8eb5c4ccebd --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareList.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Collection of all the shares on the Data Box Edge/Gateway device. + public partial class ShareList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareList, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareListInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare[] _value; + + /// The list of shares. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare[] Value { get => this._value; } + + /// Creates an new instance. + public ShareList() + { + + } + } + /// Collection of all the shares on the Data Box Edge/Gateway device. + public partial interface IShareList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Link to the next set of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of shares. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of shares.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare[] Value { get; } + + } + /// Collection of all the shares on the Data Box Edge/Gateway device. + internal partial interface IShareListInternal + + { + /// Link to the next set of results. + string NextLink { get; set; } + /// The list of shares. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareList.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareList.json.cs new file mode 100644 index 000000000000..eef5d18d729b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareList.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Collection of all the shares on the Data Box Edge/Gateway device. + public partial class ShareList + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ShareList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ShareList(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IShare) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Share.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/ShareProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareProperties.PowerShell.cs new file mode 100644 index 000000000000..f21f4841062b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareProperties.PowerShell.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The share properties. + [System.ComponentModel.TypeConverter(typeof(SharePropertiesTypeConverter))] + public partial class ShareProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IShareProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ShareProperties(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.DataBoxEdge.Models.Api20220301.IShareProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ShareProperties(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.DataBoxEdge.Models.Api20220301.IShareProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ShareProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AzureContainerInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AzureContainerInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfo) content.GetValueForProperty("AzureContainerInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AzureContainerInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AzureContainerInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RefreshDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails) content.GetValueForProperty("RefreshDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RefreshDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ShareStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).ShareStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus) content.GetValueForProperty("ShareStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).ShareStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus.CreateFrom); + } + if (content.Contains("MonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus.CreateFrom); + } + if (content.Contains("AccessProtocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AccessProtocol = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol) content.GetValueForProperty("AccessProtocol",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AccessProtocol, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol.CreateFrom); + } + if (content.Contains("UserAccessRights")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).UserAccessRights = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight[]) content.GetValueForProperty("UserAccessRights",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).UserAccessRights, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UserAccessRightTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientAccessRights")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).ClientAccessRights = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight[]) content.GetValueForProperty("ClientAccessRights",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).ClientAccessRights, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClientAccessRightTypeConverter.ConvertFrom)); + } + if (content.Contains("ShareMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).ShareMapping = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[]) content.GetValueForProperty("ShareMapping",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).ShareMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMapTypeConverter.ConvertFrom)); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy?) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy.CreateFrom); + } + if (content.Contains("AzureContainerInfoContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AzureContainerInfoContainerName = (string) content.GetValueForProperty("AzureContainerInfoContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AzureContainerInfoContainerName, global::System.Convert.ToString); + } + if (content.Contains("RefreshDetailLastJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetailLastJob = (string) content.GetValueForProperty("RefreshDetailLastJob",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetailLastJob, global::System.Convert.ToString); + } + if (content.Contains("AzureContainerInfoStorageAccountCredentialId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AzureContainerInfoStorageAccountCredentialId = (string) content.GetValueForProperty("AzureContainerInfoStorageAccountCredentialId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AzureContainerInfoStorageAccountCredentialId, global::System.Convert.ToString); + } + if (content.Contains("AzureContainerInfoDataFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AzureContainerInfoDataFormat = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat) content.GetValueForProperty("AzureContainerInfoDataFormat",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AzureContainerInfoDataFormat, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat.CreateFrom); + } + if (content.Contains("RefreshDetailInProgressRefreshJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetailInProgressRefreshJobId = (string) content.GetValueForProperty("RefreshDetailInProgressRefreshJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetailInProgressRefreshJobId, global::System.Convert.ToString); + } + if (content.Contains("RefreshDetailLastCompletedRefreshJobTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetailLastCompletedRefreshJobTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RefreshDetailLastCompletedRefreshJobTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetailLastCompletedRefreshJobTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RefreshDetailErrorManifestFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetailErrorManifestFile = (string) content.GetValueForProperty("RefreshDetailErrorManifestFile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetailErrorManifestFile, 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 ShareProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AzureContainerInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AzureContainerInfo = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfo) content.GetValueForProperty("AzureContainerInfo",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AzureContainerInfo, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AzureContainerInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RefreshDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetail = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails) content.GetValueForProperty("RefreshDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetail, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RefreshDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ShareStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).ShareStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus) content.GetValueForProperty("ShareStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).ShareStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus.CreateFrom); + } + if (content.Contains("MonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus.CreateFrom); + } + if (content.Contains("AccessProtocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AccessProtocol = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol) content.GetValueForProperty("AccessProtocol",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AccessProtocol, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol.CreateFrom); + } + if (content.Contains("UserAccessRights")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).UserAccessRights = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight[]) content.GetValueForProperty("UserAccessRights",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).UserAccessRights, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UserAccessRightTypeConverter.ConvertFrom)); + } + if (content.Contains("ClientAccessRights")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).ClientAccessRights = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight[]) content.GetValueForProperty("ClientAccessRights",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).ClientAccessRights, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClientAccessRightTypeConverter.ConvertFrom)); + } + if (content.Contains("ShareMapping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).ShareMapping = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[]) content.GetValueForProperty("ShareMapping",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).ShareMapping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMapTypeConverter.ConvertFrom)); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy?) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy.CreateFrom); + } + if (content.Contains("AzureContainerInfoContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AzureContainerInfoContainerName = (string) content.GetValueForProperty("AzureContainerInfoContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AzureContainerInfoContainerName, global::System.Convert.ToString); + } + if (content.Contains("RefreshDetailLastJob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetailLastJob = (string) content.GetValueForProperty("RefreshDetailLastJob",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetailLastJob, global::System.Convert.ToString); + } + if (content.Contains("AzureContainerInfoStorageAccountCredentialId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AzureContainerInfoStorageAccountCredentialId = (string) content.GetValueForProperty("AzureContainerInfoStorageAccountCredentialId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AzureContainerInfoStorageAccountCredentialId, global::System.Convert.ToString); + } + if (content.Contains("AzureContainerInfoDataFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AzureContainerInfoDataFormat = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat) content.GetValueForProperty("AzureContainerInfoDataFormat",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).AzureContainerInfoDataFormat, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat.CreateFrom); + } + if (content.Contains("RefreshDetailInProgressRefreshJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetailInProgressRefreshJobId = (string) content.GetValueForProperty("RefreshDetailInProgressRefreshJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetailInProgressRefreshJobId, global::System.Convert.ToString); + } + if (content.Contains("RefreshDetailLastCompletedRefreshJobTimeInUtc")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetailLastCompletedRefreshJobTimeInUtc = (global::System.DateTime?) content.GetValueForProperty("RefreshDetailLastCompletedRefreshJobTimeInUtc",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetailLastCompletedRefreshJobTimeInUtc, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RefreshDetailErrorManifestFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetailErrorManifestFile = (string) content.GetValueForProperty("RefreshDetailErrorManifestFile",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal)this).RefreshDetailErrorManifestFile, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The share properties. + [System.ComponentModel.TypeConverter(typeof(SharePropertiesTypeConverter))] + public partial interface IShareProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareProperties.TypeConverter.cs new file mode 100644 index 000000000000..0b00aad52b83 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SharePropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IShareProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ShareProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ShareProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ShareProperties.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/databoxedge/generated/api/Models/Api20220301/ShareProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareProperties.cs new file mode 100644 index 000000000000..b174846dc486 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareProperties.cs @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The share properties. + public partial class ShareProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol _accessProtocol; + + /// Access protocol to be used by the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol AccessProtocol { get => this._accessProtocol; set => this._accessProtocol = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfo _azureContainerInfo; + + /// Azure container mapping for the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfo AzureContainerInfo { get => (this._azureContainerInfo = this._azureContainerInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AzureContainerInfo()); set => this._azureContainerInfo = value; } + + /// + /// Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob). + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string AzureContainerInfoContainerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfoInternal)AzureContainerInfo).ContainerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfoInternal)AzureContainerInfo).ContainerName = value ?? null; } + + /// Storage format used for the file represented by the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat? AzureContainerInfoDataFormat { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfoInternal)AzureContainerInfo).DataFormat; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfoInternal)AzureContainerInfo).DataFormat = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat)""); } + + /// ID of the storage account credential used to access storage. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string AzureContainerInfoStorageAccountCredentialId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfoInternal)AzureContainerInfo).StorageAccountCredentialId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfoInternal)AzureContainerInfo).StorageAccountCredentialId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight[] _clientAccessRights; + + /// + /// List of IP addresses and corresponding access rights on the share(required for NFS protocol). + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight[] ClientAccessRights { get => this._clientAccessRights; set => this._clientAccessRights = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy? _dataPolicy; + + /// Data policy of the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy? DataPolicy { get => this._dataPolicy; set => this._dataPolicy = value; } + + /// Backing field for property. + private string _description; + + /// Description for the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Internal Acessors for AzureContainerInfo + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfo Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal.AzureContainerInfo { get => (this._azureContainerInfo = this._azureContainerInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AzureContainerInfo()); set { {_azureContainerInfo = value;} } } + + /// Internal Acessors for RefreshDetail + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal.RefreshDetail { get => (this._refreshDetail = this._refreshDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RefreshDetails()); set { {_refreshDetail = value;} } } + + /// Internal Acessors for ShareMapping + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISharePropertiesInternal.ShareMapping { get => this._shareMapping; set { {_shareMapping = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus _monitoringStatus; + + /// Current monitoring status of the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus MonitoringStatus { get => this._monitoringStatus; set => this._monitoringStatus = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails _refreshDetail; + + /// Details of the refresh job on this share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails RefreshDetail { get => (this._refreshDetail = this._refreshDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RefreshDetails()); set => this._refreshDetail = value; } + + /// + /// Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This + /// could be a failed job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string RefreshDetailErrorManifestFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)RefreshDetail).ErrorManifestFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)RefreshDetail).ErrorManifestFile = value ?? null; } + + /// + /// If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that + /// job. The field is empty if no job is in progress. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string RefreshDetailInProgressRefreshJobId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)RefreshDetail).InProgressRefreshJobId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)RefreshDetail).InProgressRefreshJobId = value ?? null; } + + /// + /// Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed + /// job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? RefreshDetailLastCompletedRefreshJobTimeInUtc { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)RefreshDetail).LastCompletedRefreshJobTimeInUtc; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)RefreshDetail).LastCompletedRefreshJobTimeInUtc = value ?? default(global::System.DateTime); } + + /// + /// Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a + /// successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string RefreshDetailLastJob { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)RefreshDetail).LastJob; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetailsInternal)RefreshDetail).LastJob = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] _shareMapping; + + /// Share mount point to the role. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] ShareMapping { get => this._shareMapping; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus _shareStatus; + + /// Current status of the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus ShareStatus { get => this._shareStatus; set => this._shareStatus = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight[] _userAccessRights; + + /// + /// Mapping of users and corresponding access rights on the share (required for SMB protocol). + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight[] UserAccessRights { get => this._userAccessRights; set => this._userAccessRights = value; } + + /// Creates an new instance. + public ShareProperties() + { + + } + } + /// The share properties. + public partial interface IShareProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Access protocol to be used by the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Access protocol to be used by the share.", + SerializedName = @"accessProtocol", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol AccessProtocol { get; set; } + /// + /// Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob). + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob).", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + string AzureContainerInfoContainerName { get; set; } + /// Storage format used for the file represented by the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage format used for the file represented by the share.", + SerializedName = @"dataFormat", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat? AzureContainerInfoDataFormat { get; set; } + /// ID of the storage account credential used to access storage. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the storage account credential used to access storage.", + SerializedName = @"storageAccountCredentialId", + PossibleTypes = new [] { typeof(string) })] + string AzureContainerInfoStorageAccountCredentialId { get; set; } + /// + /// List of IP addresses and corresponding access rights on the share(required for NFS protocol). + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of IP addresses and corresponding access rights on the share(required for NFS protocol).", + SerializedName = @"clientAccessRights", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight[] ClientAccessRights { get; set; } + /// Data policy of the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data policy of the share.", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy? DataPolicy { get; set; } + /// Description for the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description for the share.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Current monitoring status of the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Current monitoring status of the share.", + SerializedName = @"monitoringStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus MonitoringStatus { get; set; } + /// + /// Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This + /// could be a failed job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This could be a failed job or a successful job.", + SerializedName = @"errorManifestFile", + PossibleTypes = new [] { typeof(string) })] + string RefreshDetailErrorManifestFile { get; set; } + /// + /// If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that + /// job. The field is empty if no job is in progress. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that job. The field is empty if no job is in progress.", + SerializedName = @"inProgressRefreshJobId", + PossibleTypes = new [] { typeof(string) })] + string RefreshDetailInProgressRefreshJobId { get; set; } + /// + /// Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed + /// job or a successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed job or a successful job.", + SerializedName = @"lastCompletedRefreshJobTimeInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RefreshDetailLastCompletedRefreshJobTimeInUtc { get; set; } + /// + /// Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a + /// successful job. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a successful job.", + SerializedName = @"lastJob", + PossibleTypes = new [] { typeof(string) })] + string RefreshDetailLastJob { get; set; } + /// Share mount point to the role. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Share mount point to the role.", + SerializedName = @"shareMappings", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] ShareMapping { get; } + /// Current status of the share. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Current status of the share.", + SerializedName = @"shareStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus ShareStatus { get; set; } + /// + /// Mapping of users and corresponding access rights on the share (required for SMB protocol). + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mapping of users and corresponding access rights on the share (required for SMB protocol).", + SerializedName = @"userAccessRights", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight[] UserAccessRights { get; set; } + + } + /// The share properties. + internal partial interface ISharePropertiesInternal + + { + /// Access protocol to be used by the share. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol AccessProtocol { get; set; } + /// Azure container mapping for the share. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAzureContainerInfo AzureContainerInfo { get; set; } + /// + /// Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob). + /// + string AzureContainerInfoContainerName { get; set; } + /// Storage format used for the file represented by the share. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat? AzureContainerInfoDataFormat { get; set; } + /// ID of the storage account credential used to access storage. + string AzureContainerInfoStorageAccountCredentialId { get; set; } + /// + /// List of IP addresses and corresponding access rights on the share(required for NFS protocol). + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight[] ClientAccessRights { get; set; } + /// Data policy of the share. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy? DataPolicy { get; set; } + /// Description for the share. + string Description { get; set; } + /// Current monitoring status of the share. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus MonitoringStatus { get; set; } + /// Details of the refresh job on this share. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRefreshDetails RefreshDetail { get; set; } + /// + /// Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This + /// could be a failed job or a successful job. + /// + string RefreshDetailErrorManifestFile { get; set; } + /// + /// If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that + /// job. The field is empty if no job is in progress. + /// + string RefreshDetailInProgressRefreshJobId { get; set; } + /// + /// Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed + /// job or a successful job. + /// + global::System.DateTime? RefreshDetailLastCompletedRefreshJobTimeInUtc { get; set; } + /// + /// Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a + /// successful job. + /// + string RefreshDetailLastJob { get; set; } + /// Share mount point to the role. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap[] ShareMapping { get; set; } + /// Current status of the share. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus ShareStatus { get; set; } + /// + /// Mapping of users and corresponding access rights on the share (required for SMB protocol). + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight[] UserAccessRights { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareProperties.json.cs new file mode 100644 index 000000000000..f87f48c975ca --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/ShareProperties.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The share properties. + public partial class ShareProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new ShareProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal ShareProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_azureContainerInfo = If( json?.PropertyT("azureContainerInfo"), out var __jsonAzureContainerInfo) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AzureContainerInfo.FromJson(__jsonAzureContainerInfo) : AzureContainerInfo;} + {_refreshDetail = If( json?.PropertyT("refreshDetails"), out var __jsonRefreshDetails) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RefreshDetails.FromJson(__jsonRefreshDetails) : RefreshDetail;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_shareStatus = If( json?.PropertyT("shareStatus"), out var __jsonShareStatus) ? (string)__jsonShareStatus : (string)ShareStatus;} + {_monitoringStatus = If( json?.PropertyT("monitoringStatus"), out var __jsonMonitoringStatus) ? (string)__jsonMonitoringStatus : (string)MonitoringStatus;} + {_accessProtocol = If( json?.PropertyT("accessProtocol"), out var __jsonAccessProtocol) ? (string)__jsonAccessProtocol : (string)AccessProtocol;} + {_userAccessRights = If( json?.PropertyT("userAccessRights"), out var __jsonUserAccessRights) ? If( __jsonUserAccessRights as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IUserAccessRight) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UserAccessRight.FromJson(__u) )) ))() : null : UserAccessRights;} + {_clientAccessRights = If( json?.PropertyT("clientAccessRights"), out var __jsonClientAccessRights) ? If( __jsonClientAccessRights as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IClientAccessRight) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ClientAccessRight.FromJson(__p) )) ))() : null : ClientAccessRights;} + {_shareMapping = If( json?.PropertyT("shareMappings"), out var __jsonShareMappings) ? If( __jsonShareMappings as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMountPointMap) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MountPointMap.FromJson(__k) )) ))() : null : ShareMapping;} + {_dataPolicy = If( json?.PropertyT("dataPolicy"), out var __jsonDataPolicy) ? (string)__jsonDataPolicy : (string)DataPolicy;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._azureContainerInfo ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._azureContainerInfo.ToJson(null,serializationMode) : null, "azureContainerInfo" ,container.Add ); + AddIf( null != this._refreshDetail ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._refreshDetail.ToJson(null,serializationMode) : null, "refreshDetails" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._shareStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._shareStatus.ToString()) : null, "shareStatus" ,container.Add ); + AddIf( null != (((object)this._monitoringStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._monitoringStatus.ToString()) : null, "monitoringStatus" ,container.Add ); + AddIf( null != (((object)this._accessProtocol)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._accessProtocol.ToString()) : null, "accessProtocol" ,container.Add ); + if (null != this._userAccessRights) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._userAccessRights ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("userAccessRights",__w); + } + if (null != this._clientAccessRights) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __s in this._clientAccessRights ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("clientAccessRights",__r); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._shareMapping) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __n in this._shareMapping ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("shareMappings",__m); + } + } + AddIf( null != (((object)this._dataPolicy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/Sku.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Sku.PowerShell.cs new file mode 100644 index 000000000000..db887d7a4a9a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Sku.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The SKU type. + [System.ComponentModel.TypeConverter(typeof(SkuTypeConverter))] + public partial class Sku + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.ISku DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Sku(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.DataBoxEdge.Models.Api20220301.ISku DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Sku(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.DataBoxEdge.Models.Api20220301.ISku FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Sku(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.DataBoxEdge.Models.Api20220301.ISkuInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName?) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName.CreateFrom); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuInternal)this).Tier = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier?) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuInternal)this).Tier, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Sku(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.DataBoxEdge.Models.Api20220301.ISkuInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName?) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName.CreateFrom); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuInternal)this).Tier = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier?) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuInternal)this).Tier, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The SKU type. + [System.ComponentModel.TypeConverter(typeof(SkuTypeConverter))] + public partial interface ISku + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Sku.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Sku.TypeConverter.cs new file mode 100644 index 000000000000..8212534b0df3 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Sku.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SkuTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ISku ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISku).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Sku.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Sku.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Sku.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/databoxedge/generated/api/Models/Api20220301/Sku.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Sku.cs new file mode 100644 index 000000000000..1f2f47f1d05f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Sku.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The SKU type. + public partial class Sku : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISku, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName? _name; + + /// SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName? Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier? _tier; + + /// The SKU tier. This is based on the SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier? Tier { get => this._tier; set => this._tier = value; } + + /// Creates an new instance. + public Sku() + { + + } + } + /// The SKU type. + public partial interface ISku : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SKU name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName? Name { get; set; } + /// The SKU tier. This is based on the SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SKU tier. This is based on the SKU name.", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier? Tier { get; set; } + + } + /// The SKU type. + internal partial interface ISkuInternal + + { + /// SKU name. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName? Name { get; set; } + /// The SKU tier. This is based on the SKU name. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier? Tier { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Sku.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Sku.json.cs new file mode 100644 index 000000000000..8260bbb4aa37 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Sku.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The SKU type. + public partial class Sku + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISku. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISku. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISku FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new Sku(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal Sku(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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;} + {_tier = If( json?.PropertyT("tier"), out var __jsonTier) ? (string)__jsonTier : (string)Tier;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._tier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._tier.ToString()) : null, "tier" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCapability.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCapability.PowerShell.cs new file mode 100644 index 000000000000..93681d3a40f1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCapability.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The metadata to describe the capability. + [System.ComponentModel.TypeConverter(typeof(SkuCapabilityTypeConverter))] + public partial class SkuCapability + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.ISkuCapability DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SkuCapability(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.DataBoxEdge.Models.Api20220301.ISkuCapability DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SkuCapability(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.DataBoxEdge.Models.Api20220301.ISkuCapability FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SkuCapability(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.DataBoxEdge.Models.Api20220301.ISkuCapabilityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapabilityInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapabilityInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapabilityInternal)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 SkuCapability(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.DataBoxEdge.Models.Api20220301.ISkuCapabilityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapabilityInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapabilityInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapabilityInternal)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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The metadata to describe the capability. + [System.ComponentModel.TypeConverter(typeof(SkuCapabilityTypeConverter))] + public partial interface ISkuCapability + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCapability.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCapability.TypeConverter.cs new file mode 100644 index 000000000000..0638e44a6307 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCapability.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SkuCapabilityTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ISkuCapability ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapability).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SkuCapability.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SkuCapability.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SkuCapability.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/databoxedge/generated/api/Models/Api20220301/SkuCapability.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCapability.cs new file mode 100644 index 000000000000..d91f69ac1b2a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCapability.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The metadata to describe the capability. + public partial class SkuCapability : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapability, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapabilityInternal + { + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapabilityInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Value + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapabilityInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _name; + + /// An invariant to describe the feature. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _value; + + /// An invariant if the feature is measured by quantity. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Value { get => this._value; } + + /// Creates an new instance. + public SkuCapability() + { + + } + } + /// The metadata to describe the capability. + public partial interface ISkuCapability : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// An invariant to describe the feature. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"An invariant to describe the feature.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// An invariant if the feature is measured by quantity. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"An invariant if the feature is measured by quantity.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; } + + } + /// The metadata to describe the capability. + internal partial interface ISkuCapabilityInternal + + { + /// An invariant to describe the feature. + string Name { get; set; } + /// An invariant if the feature is measured by quantity. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCapability.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCapability.json.cs new file mode 100644 index 000000000000..dadf189d6294 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCapability.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The metadata to describe the capability. + public partial class SkuCapability + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapability. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapability. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCapability FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new SkuCapability(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal SkuCapability(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/SkuCost.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCost.PowerShell.cs new file mode 100644 index 000000000000..dcea405f455a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCost.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The metadata for retrieving price info. + [System.ComponentModel.TypeConverter(typeof(SkuCostTypeConverter))] + public partial class SkuCost + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.ISkuCost DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SkuCost(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.DataBoxEdge.Models.Api20220301.ISkuCost DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SkuCost(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.DataBoxEdge.Models.Api20220301.ISkuCost FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SkuCost(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCostInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCostInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCostInternal)this).Quantity = (long?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCostInternal)this).Quantity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ExtendedUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCostInternal)this).ExtendedUnit = (string) content.GetValueForProperty("ExtendedUnit",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCostInternal)this).ExtendedUnit, 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 SkuCost(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MeterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCostInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCostInternal)this).MeterId, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCostInternal)this).Quantity = (long?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCostInternal)this).Quantity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ExtendedUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCostInternal)this).ExtendedUnit = (string) content.GetValueForProperty("ExtendedUnit",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCostInternal)this).ExtendedUnit, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The metadata for retrieving price info. + [System.ComponentModel.TypeConverter(typeof(SkuCostTypeConverter))] + public partial interface ISkuCost + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCost.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCost.TypeConverter.cs new file mode 100644 index 000000000000..06e77b750c11 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCost.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SkuCostTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ISkuCost ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCost).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SkuCost.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SkuCost.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SkuCost.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/databoxedge/generated/api/Models/Api20220301/SkuCost.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCost.cs new file mode 100644 index 000000000000..a1914d4f57db --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCost.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The metadata for retrieving price info. + public partial class SkuCost : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCost, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCostInternal + { + + /// Backing field for property. + private string _extendedUnit; + + /// The extended unit. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ExtendedUnit { get => this._extendedUnit; } + + /// Backing field for property. + private string _meterId; + + /// Used for querying price from commerce. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string MeterId { get => this._meterId; } + + /// Internal Acessors for ExtendedUnit + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCostInternal.ExtendedUnit { get => this._extendedUnit; set { {_extendedUnit = value;} } } + + /// Internal Acessors for MeterId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCostInternal.MeterId { get => this._meterId; set { {_meterId = value;} } } + + /// Internal Acessors for Quantity + long? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCostInternal.Quantity { get => this._quantity; set { {_quantity = value;} } } + + /// Backing field for property. + private long? _quantity; + + /// The cost quantity. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public long? Quantity { get => this._quantity; } + + /// Creates an new instance. + public SkuCost() + { + + } + } + /// The metadata for retrieving price info. + public partial interface ISkuCost : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The extended unit. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The extended unit.", + SerializedName = @"extendedUnit", + PossibleTypes = new [] { typeof(string) })] + string ExtendedUnit { get; } + /// Used for querying price from commerce. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Used for querying price from commerce.", + SerializedName = @"meterId", + PossibleTypes = new [] { typeof(string) })] + string MeterId { get; } + /// The cost quantity. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The cost quantity.", + SerializedName = @"quantity", + PossibleTypes = new [] { typeof(long) })] + long? Quantity { get; } + + } + /// The metadata for retrieving price info. + internal partial interface ISkuCostInternal + + { + /// The extended unit. + string ExtendedUnit { get; set; } + /// Used for querying price from commerce. + string MeterId { get; set; } + /// The cost quantity. + long? Quantity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCost.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCost.json.cs new file mode 100644 index 000000000000..d48954d07773 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuCost.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The metadata for retrieving price info. + public partial class SkuCost + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCost. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCost. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuCost FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new SkuCost(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal SkuCost(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_meterId = If( json?.PropertyT("meterId"), out var __jsonMeterId) ? (string)__jsonMeterId : (string)MeterId;} + {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (long?)__jsonQuantity : Quantity;} + {_extendedUnit = If( json?.PropertyT("extendedUnit"), out var __jsonExtendedUnit) ? (string)__jsonExtendedUnit : (string)ExtendedUnit;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._meterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._meterId.ToString()) : null, "meterId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._quantity ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((long)this._quantity) : null, "quantity" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._extendedUnit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._extendedUnit.ToString()) : null, "extendedUnit" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuLocationInfo.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuLocationInfo.PowerShell.cs new file mode 100644 index 000000000000..7d6635f94c82 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuLocationInfo.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The location info. + [System.ComponentModel.TypeConverter(typeof(SkuLocationInfoTypeConverter))] + public partial class SkuLocationInfo + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.ISkuLocationInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SkuLocationInfo(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.DataBoxEdge.Models.Api20220301.ISkuLocationInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SkuLocationInfo(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.DataBoxEdge.Models.Api20220301.ISkuLocationInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SkuLocationInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfoInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfoInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfoInternal)this).Zone = (string[]) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfoInternal)this).Zone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Site")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfoInternal)this).Site = (string[]) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfoInternal)this).Site, __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 SkuLocationInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfoInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfoInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfoInternal)this).Zone = (string[]) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfoInternal)this).Zone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Site")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfoInternal)this).Site = (string[]) content.GetValueForProperty("Site",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfoInternal)this).Site, __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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The location info. + [System.ComponentModel.TypeConverter(typeof(SkuLocationInfoTypeConverter))] + public partial interface ISkuLocationInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuLocationInfo.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuLocationInfo.TypeConverter.cs new file mode 100644 index 000000000000..aa10f4c15e37 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuLocationInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SkuLocationInfoTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ISkuLocationInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SkuLocationInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SkuLocationInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SkuLocationInfo.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/databoxedge/generated/api/Models/Api20220301/SkuLocationInfo.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuLocationInfo.cs new file mode 100644 index 000000000000..46add8473f9f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuLocationInfo.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The location info. + public partial class SkuLocationInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfoInternal + { + + /// Backing field for property. + private string _location; + + /// The location. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Location { get => this._location; } + + /// Internal Acessors for Location + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfoInternal.Location { get => this._location; set { {_location = value;} } } + + /// Internal Acessors for Site + string[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfoInternal.Site { get => this._site; set { {_site = value;} } } + + /// Internal Acessors for Zone + string[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfoInternal.Zone { get => this._zone; set { {_zone = value;} } } + + /// Backing field for property. + private string[] _site; + + /// The sites. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string[] Site { get => this._site; } + + /// Backing field for property. + private string[] _zone; + + /// The zones. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string[] Zone { get => this._zone; } + + /// Creates an new instance. + public SkuLocationInfo() + { + + } + } + /// The location info. + public partial interface ISkuLocationInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The location. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The location.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; } + /// The sites. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The sites.", + SerializedName = @"sites", + PossibleTypes = new [] { typeof(string) })] + string[] Site { get; } + /// The zones. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The zones.", + SerializedName = @"zones", + PossibleTypes = new [] { typeof(string) })] + string[] Zone { get; } + + } + /// The location info. + internal partial interface ISkuLocationInfoInternal + + { + /// The location. + string Location { get; set; } + /// The sites. + string[] Site { get; set; } + /// The zones. + string[] Zone { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuLocationInfo.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuLocationInfo.json.cs new file mode 100644 index 000000000000..d60f37596132 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SkuLocationInfo.json.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The location info. + public partial class SkuLocationInfo + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISkuLocationInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new SkuLocationInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal SkuLocationInfo(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_zone = If( json?.PropertyT("zones"), out var __jsonZones) ? If( __jsonZones as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Zone;} + {_site = If( json?.PropertyT("sites"), out var __jsonSites) ? If( __jsonSites as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : Site;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._zone) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._zone ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("zones",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._site) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __s in this._site ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("sites",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccount.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccount.PowerShell.cs new file mode 100644 index 000000000000..9e1b557ca43a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccount.PowerShell.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Represents a Storage Account on the Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(StorageAccountTypeConverter))] + public partial class StorageAccount + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IStorageAccount DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccount(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.DataBoxEdge.Models.Api20220301.IStorageAccount DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccount(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.DataBoxEdge.Models.Api20220301.IStorageAccount FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccount(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.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy.CreateFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus.CreateFrom); + } + if (content.Contains("CredentialId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).CredentialId = (string) content.GetValueForProperty("CredentialId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).CredentialId, global::System.Convert.ToString); + } + if (content.Contains("BlobEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).BlobEndpoint = (string) content.GetValueForProperty("BlobEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).BlobEndpoint, global::System.Convert.ToString); + } + if (content.Contains("ContainerCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).ContainerCount = (int?) content.GetValueForProperty("ContainerCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).ContainerCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataLastModifiedAt, (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 StorageAccount(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.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy.CreateFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus.CreateFrom); + } + if (content.Contains("CredentialId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).CredentialId = (string) content.GetValueForProperty("CredentialId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).CredentialId, global::System.Convert.ToString); + } + if (content.Contains("BlobEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).BlobEndpoint = (string) content.GetValueForProperty("BlobEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).BlobEndpoint, global::System.Convert.ToString); + } + if (content.Contains("ContainerCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).ContainerCount = (int?) content.GetValueForProperty("ContainerCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).ContainerCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal)this).SystemDataLastModifiedAt, (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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Represents a Storage Account on the Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(StorageAccountTypeConverter))] + public partial interface IStorageAccount + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccount.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccount.TypeConverter.cs new file mode 100644 index 000000000000..c4f61b69ed64 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccount.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IStorageAccount ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccount.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccount.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccount.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/databoxedge/generated/api/Models/Api20220301/StorageAccount.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccount.cs new file mode 100644 index 000000000000..1b95cdc270f1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccount.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Represents a Storage Account on the Data Box Edge/Gateway device. + public partial class StorageAccount : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// BlobEndpoint of Storage Account + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string BlobEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)Property).BlobEndpoint; } + + /// + /// The Container Count. Present only for Storage Accounts with DataPolicy set to Cloud. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? ContainerCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)Property).ContainerCount; } + + /// Storage Account Credential Id + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string CredentialId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)Property).StorageAccountCredentialId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)Property).StorageAccountCredentialId = value ?? null; } + + /// Data policy of the storage Account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy DataPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)Property).DataPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)Property).DataPolicy = value ; } + + /// Description for the storage Account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)Property).Description = value ?? null; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for BlobEndpoint + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal.BlobEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)Property).BlobEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)Property).BlobEndpoint = value; } + + /// Internal Acessors for ContainerCount + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal.ContainerCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)Property).ContainerCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)Property).ContainerCount = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountProperties()); set { {_property = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountProperties _property; + + /// The Storage Account properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountProperties()); set => this._property = value; } + + /// Current status of the storage account + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)Property).StorageAccountStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)Property).StorageAccountStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of StorageAccount + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Creates an new instance. + public StorageAccount() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// Represents a Storage Account on the Data Box Edge/Gateway device. + public partial interface IStorageAccount : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// BlobEndpoint of Storage Account + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"BlobEndpoint of Storage Account", + SerializedName = @"blobEndpoint", + PossibleTypes = new [] { typeof(string) })] + string BlobEndpoint { get; } + /// + /// The Container Count. Present only for Storage Accounts with DataPolicy set to Cloud. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Container Count. Present only for Storage Accounts with DataPolicy set to Cloud.", + SerializedName = @"containerCount", + PossibleTypes = new [] { typeof(int) })] + int? ContainerCount { get; } + /// Storage Account Credential Id + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Credential Id", + SerializedName = @"storageAccountCredentialId", + PossibleTypes = new [] { typeof(string) })] + string CredentialId { get; set; } + /// Data policy of the storage Account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data policy of the storage Account.", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy DataPolicy { get; set; } + /// Description for the storage Account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description for the storage Account.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Current status of the storage account + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Current status of the storage account", + SerializedName = @"storageAccountStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus? Status { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// Represents a Storage Account on the Data Box Edge/Gateway device. + internal partial interface IStorageAccountInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// BlobEndpoint of Storage Account + string BlobEndpoint { get; set; } + /// + /// The Container Count. Present only for Storage Accounts with DataPolicy set to Cloud. + /// + int? ContainerCount { get; set; } + /// Storage Account Credential Id + string CredentialId { get; set; } + /// Data policy of the storage Account. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy DataPolicy { get; set; } + /// Description for the storage Account. + string Description { get; set; } + /// The Storage Account properties. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountProperties Property { get; set; } + /// Current status of the storage account + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus? Status { get; set; } + /// Metadata pertaining to creation and last modification of StorageAccount + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccount.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccount.json.cs new file mode 100644 index 000000000000..5933d958debb --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccount.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Represents a Storage Account on the Data Box Edge/Gateway device. + public partial class StorageAccount + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new StorageAccount(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccount(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredential.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredential.PowerShell.cs new file mode 100644 index 000000000000..594b288e234e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredential.PowerShell.cs @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IStorageAccountCredential FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountCredentialPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SslStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SslStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus) content.GetValueForProperty("SslStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SslStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus.CreateFrom); + } + if (content.Contains("AccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType) content.GetValueForProperty("AccountType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType.CreateFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("AccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("Alias")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).Alias = (string) content.GetValueForProperty("Alias",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).Alias, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).ConnectionString = (string) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).ConnectionString, global::System.Convert.ToString); + } + if (content.Contains("BlobDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).BlobDomainName = (string) content.GetValueForProperty("BlobDomainName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).BlobDomainName, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("AccountKeyEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountKeyEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("AccountKeyEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountKeyEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AccountKeyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountKeyValue = (string) content.GetValueForProperty("AccountKeyValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountKeyValue, global::System.Convert.ToString); + } + if (content.Contains("AccountKeyEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountKeyEncryptionCertThumbprint = (string) content.GetValueForProperty("AccountKeyEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountKeyEncryptionCertThumbprint, 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.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountCredentialPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SslStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SslStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus) content.GetValueForProperty("SslStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SslStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus.CreateFrom); + } + if (content.Contains("AccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType) content.GetValueForProperty("AccountType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType.CreateFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("AccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("Alias")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).Alias = (string) content.GetValueForProperty("Alias",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).Alias, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).ConnectionString = (string) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).ConnectionString, global::System.Convert.ToString); + } + if (content.Contains("BlobDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).BlobDomainName = (string) content.GetValueForProperty("BlobDomainName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).BlobDomainName, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("AccountKeyEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountKeyEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("AccountKeyEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountKeyEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AccountKeyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountKeyValue = (string) content.GetValueForProperty("AccountKeyValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountKeyValue, global::System.Convert.ToString); + } + if (content.Contains("AccountKeyEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountKeyEncryptionCertThumbprint = (string) content.GetValueForProperty("AccountKeyEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal)this).AccountKeyEncryptionCertThumbprint, 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.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/StorageAccountCredential.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredential.TypeConverter.cs new file mode 100644 index 000000000000..b6f76a622658 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IStorageAccountCredential ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/StorageAccountCredential.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredential.cs new file mode 100644 index 000000000000..8c7723839df4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredential.cs @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The storage account credential. + public partial class StorageAccountCredential : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? AccountKeyEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).AccountKeyEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).AccountKeyEncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string AccountKeyEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).AccountKeyEncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).AccountKeyEncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string AccountKeyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).AccountKeyValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).AccountKeyValue = value ?? null; } + + /// Type of storage accessed on the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType AccountType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).AccountType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).AccountType = value ; } + + /// Alias for the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Alias { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).Alias; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).Alias = value ; } + + /// Blob end point for private clouds. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string BlobDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).BlobDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).BlobDomainName = value ?? null; } + + /// + /// Connection string for the storage account. Use this string if username and account key are not specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).ConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).ConnectionString = value ?? null; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for AccountKey + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal.AccountKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).AccountKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).AccountKey = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountCredentialProperties()); set { {_property = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialProperties _property; + + /// The storage account credential properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountCredentialProperties()); set => this._property = value; } + + /// Signifies whether SSL needs to be enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus SslStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).SslStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).SslStatus = value ; } + + /// Id of the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string StorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).StorageAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).StorageAccountId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// + /// Metadata pertaining to creation and last modification of StorageAccountCredential + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Username for the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string UserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).UserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)Property).UserName = value ?? null; } + + /// Creates an new instance. + public StorageAccountCredential() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// The storage account credential. + public partial interface IStorageAccountCredential : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? AccountKeyEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string AccountKeyEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string AccountKeyValue { get; set; } + /// Type of storage accessed on the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of storage accessed on the storage account.", + SerializedName = @"accountType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType AccountType { get; set; } + /// Alias for the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Alias for the storage account.", + SerializedName = @"alias", + PossibleTypes = new [] { typeof(string) })] + string Alias { get; set; } + /// Blob end point for private clouds. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Blob end point for private clouds.", + SerializedName = @"blobDomainName", + PossibleTypes = new [] { typeof(string) })] + string BlobDomainName { get; set; } + /// + /// Connection string for the storage account. Use this string if username and account key are not specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Connection string for the storage account. Use this string if username and account key are not specified.", + SerializedName = @"connectionString", + PossibleTypes = new [] { typeof(string) })] + string ConnectionString { get; set; } + /// Signifies whether SSL needs to be enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Signifies whether SSL needs to be enabled or not.", + SerializedName = @"sslStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus SslStatus { get; set; } + /// Id of the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id of the storage account.", + SerializedName = @"storageAccountId", + PossibleTypes = new [] { typeof(string) })] + string StorageAccountId { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Username for the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Username for the storage account.", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string UserName { get; set; } + + } + /// The storage account credential. + internal partial interface IStorageAccountCredentialInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// Encrypted storage key. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret AccountKey { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? AccountKeyEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string AccountKeyEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string AccountKeyValue { get; set; } + /// Type of storage accessed on the storage account. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType AccountType { get; set; } + /// Alias for the storage account. + string Alias { get; set; } + /// Blob end point for private clouds. + string BlobDomainName { get; set; } + /// + /// Connection string for the storage account. Use this string if username and account key are not specified. + /// + string ConnectionString { get; set; } + /// The storage account credential properties. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialProperties Property { get; set; } + /// Signifies whether SSL needs to be enabled or not. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus SslStatus { get; set; } + /// Id of the storage account. + string StorageAccountId { get; set; } + /// + /// Metadata pertaining to creation and last modification of StorageAccountCredential + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Username for the storage account. + string UserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredential.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredential.json.cs new file mode 100644 index 000000000000..6e934ad93c1c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredential.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new StorageAccountCredential(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountCredential(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountCredentialProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialList.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialList.PowerShell.cs new file mode 100644 index 000000000000..ade6c1d904e6 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The collection of storage account credentials. + [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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountCredentialTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialListInternal)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 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.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountCredentialTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialListInternal)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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The collection of storage account credentials. + [System.ComponentModel.TypeConverter(typeof(StorageAccountCredentialListTypeConverter))] + public partial interface IStorageAccountCredentialList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialList.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialList.TypeConverter.cs new file mode 100644 index 000000000000..1d6eeeb5a15b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialList.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialList.cs new file mode 100644 index 000000000000..a46ace4197c4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialList.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The collection of storage account credentials. + public partial class StorageAccountCredentialList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialList, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialListInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential[] _value; + + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential[] Value { get => this._value; } + + /// Creates an new instance. + public StorageAccountCredentialList() + { + + } + } + /// The collection of storage account credentials. + public partial interface IStorageAccountCredentialList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Link to the next set of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential[] Value { get; } + + } + /// The collection of storage account credentials. + internal partial interface IStorageAccountCredentialListInternal + + { + /// Link to the next set of results. + string NextLink { get; set; } + /// The value. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialList.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialList.json.cs new file mode 100644 index 000000000000..84540e42f487 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialList.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The collection of storage account credentials. + 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new StorageAccountCredentialList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountCredentialList(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IStorageAccountCredential) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountCredential.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialProperties.PowerShell.cs new file mode 100644 index 000000000000..10d4b0aae36b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The storage account credential 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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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("AccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("AccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("Alias")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).Alias = (string) content.GetValueForProperty("Alias",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).Alias, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).ConnectionString = (string) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).ConnectionString, global::System.Convert.ToString); + } + if (content.Contains("SslStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).SslStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus) content.GetValueForProperty("SslStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).SslStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus.CreateFrom); + } + if (content.Contains("BlobDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).BlobDomainName = (string) content.GetValueForProperty("BlobDomainName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).BlobDomainName, global::System.Convert.ToString); + } + if (content.Contains("AccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType) content.GetValueForProperty("AccountType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType.CreateFrom); + } + if (content.Contains("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("AccountKeyEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountKeyEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("AccountKeyEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountKeyEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("AccountKeyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountKeyValue = (string) content.GetValueForProperty("AccountKeyValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountKeyValue, global::System.Convert.ToString); + } + if (content.Contains("AccountKeyEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountKeyEncryptionCertThumbprint = (string) content.GetValueForProperty("AccountKeyEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountKeyEncryptionCertThumbprint, 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("AccountKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountKey = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("AccountKey",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountKey, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("Alias")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).Alias = (string) content.GetValueForProperty("Alias",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).Alias, global::System.Convert.ToString); + } + if (content.Contains("UserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).UserName = (string) content.GetValueForProperty("UserName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).UserName, global::System.Convert.ToString); + } + if (content.Contains("ConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).ConnectionString = (string) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).ConnectionString, global::System.Convert.ToString); + } + if (content.Contains("SslStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).SslStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus) content.GetValueForProperty("SslStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).SslStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus.CreateFrom); + } + if (content.Contains("BlobDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).BlobDomainName = (string) content.GetValueForProperty("BlobDomainName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).BlobDomainName, global::System.Convert.ToString); + } + if (content.Contains("AccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType) content.GetValueForProperty("AccountType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType.CreateFrom); + } + if (content.Contains("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("AccountKeyEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountKeyEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("AccountKeyEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountKeyEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("AccountKeyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountKeyValue = (string) content.GetValueForProperty("AccountKeyValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountKeyValue, global::System.Convert.ToString); + } + if (content.Contains("AccountKeyEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountKeyEncryptionCertThumbprint = (string) content.GetValueForProperty("AccountKeyEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal)this).AccountKeyEncryptionCertThumbprint, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The storage account credential properties. + [System.ComponentModel.TypeConverter(typeof(StorageAccountCredentialPropertiesTypeConverter))] + public partial interface IStorageAccountCredentialProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialProperties.TypeConverter.cs new file mode 100644 index 000000000000..03da9500e0ce --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialProperties.cs new file mode 100644 index 000000000000..e0e6d65449b7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The storage account credential properties. + public partial class StorageAccountCredentialProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret _accountKey; + + /// Encrypted storage key. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret AccountKey { get => (this._accountKey = this._accountKey ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret()); set => this._accountKey = value; } + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? AccountKeyEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)AccountKey).EncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)AccountKey).EncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string AccountKeyEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)AccountKey).EncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)AccountKey).EncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string AccountKeyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)AccountKey).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)AccountKey).Value = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType _accountType; + + /// Type of storage accessed on the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType AccountType { get => this._accountType; set => this._accountType = value; } + + /// Backing field for property. + private string _alias; + + /// Alias for the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Alias { get => this._alias; set => this._alias = value; } + + /// Backing field for property. + private string _blobDomainName; + + /// Blob end point for private clouds. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string BlobDomainName { get => this._blobDomainName; set => this._blobDomainName = value; } + + /// Backing field for property. + private string _connectionString; + + /// + /// Connection string for the storage account. Use this string if username and account key are not specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ConnectionString { get => this._connectionString; set => this._connectionString = value; } + + /// Internal Acessors for AccountKey + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialPropertiesInternal.AccountKey { get => (this._accountKey = this._accountKey ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret()); set { {_accountKey = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus _sslStatus; + + /// Signifies whether SSL needs to be enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus SslStatus { get => this._sslStatus; set => this._sslStatus = value; } + + /// Backing field for property. + private string _storageAccountId; + + /// Id of the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string StorageAccountId { get => this._storageAccountId; set => this._storageAccountId = value; } + + /// Backing field for property. + private string _userName; + + /// Username for the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string UserName { get => this._userName; set => this._userName = value; } + + /// Creates an new instance. + public StorageAccountCredentialProperties() + { + + } + } + /// The storage account credential properties. + public partial interface IStorageAccountCredentialProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? AccountKeyEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string AccountKeyEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string AccountKeyValue { get; set; } + /// Type of storage accessed on the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of storage accessed on the storage account.", + SerializedName = @"accountType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType AccountType { get; set; } + /// Alias for the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Alias for the storage account.", + SerializedName = @"alias", + PossibleTypes = new [] { typeof(string) })] + string Alias { get; set; } + /// Blob end point for private clouds. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Blob end point for private clouds.", + SerializedName = @"blobDomainName", + PossibleTypes = new [] { typeof(string) })] + string BlobDomainName { get; set; } + /// + /// Connection string for the storage account. Use this string if username and account key are not specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Connection string for the storage account. Use this string if username and account key are not specified.", + SerializedName = @"connectionString", + PossibleTypes = new [] { typeof(string) })] + string ConnectionString { get; set; } + /// Signifies whether SSL needs to be enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Signifies whether SSL needs to be enabled or not.", + SerializedName = @"sslStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus SslStatus { get; set; } + /// Id of the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id of the storage account.", + SerializedName = @"storageAccountId", + PossibleTypes = new [] { typeof(string) })] + string StorageAccountId { get; set; } + /// Username for the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Username for the storage account.", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + string UserName { get; set; } + + } + /// The storage account credential properties. + internal partial interface IStorageAccountCredentialPropertiesInternal + + { + /// Encrypted storage key. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret AccountKey { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? AccountKeyEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string AccountKeyEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string AccountKeyValue { get; set; } + /// Type of storage accessed on the storage account. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType AccountType { get; set; } + /// Alias for the storage account. + string Alias { get; set; } + /// Blob end point for private clouds. + string BlobDomainName { get; set; } + /// + /// Connection string for the storage account. Use this string if username and account key are not specified. + /// + string ConnectionString { get; set; } + /// Signifies whether SSL needs to be enabled or not. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus SslStatus { get; set; } + /// Id of the storage account. + string StorageAccountId { get; set; } + /// Username for the storage account. + string UserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialProperties.json.cs new file mode 100644 index 000000000000..db6774e2f869 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountCredentialProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The storage account credential 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredentialProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new StorageAccountCredentialProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountCredentialProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_accountKey = If( json?.PropertyT("accountKey"), out var __jsonAccountKey) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret.FromJson(__jsonAccountKey) : AccountKey;} + {_alias = If( json?.PropertyT("alias"), out var __jsonAlias) ? (string)__jsonAlias : (string)Alias;} + {_userName = If( json?.PropertyT("userName"), out var __jsonUserName) ? (string)__jsonUserName : (string)UserName;} + {_connectionString = If( json?.PropertyT("connectionString"), out var __jsonConnectionString) ? (string)__jsonConnectionString : (string)ConnectionString;} + {_sslStatus = If( json?.PropertyT("sslStatus"), out var __jsonSslStatus) ? (string)__jsonSslStatus : (string)SslStatus;} + {_blobDomainName = If( json?.PropertyT("blobDomainName"), out var __jsonBlobDomainName) ? (string)__jsonBlobDomainName : (string)BlobDomainName;} + {_accountType = If( json?.PropertyT("accountType"), out var __jsonAccountType) ? (string)__jsonAccountType : (string)AccountType;} + {_storageAccountId = If( json?.PropertyT("storageAccountId"), out var __jsonStorageAccountId) ? (string)__jsonStorageAccountId : (string)StorageAccountId;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._accountKey ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._accountKey.ToJson(null,serializationMode) : null, "accountKey" ,container.Add ); + AddIf( null != (((object)this._alias)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._alias.ToString()) : null, "alias" ,container.Add ); + AddIf( null != (((object)this._userName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._userName.ToString()) : null, "userName" ,container.Add ); + AddIf( null != (((object)this._connectionString)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._connectionString.ToString()) : null, "connectionString" ,container.Add ); + AddIf( null != (((object)this._sslStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._sslStatus.ToString()) : null, "sslStatus" ,container.Add ); + AddIf( null != (((object)this._blobDomainName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._blobDomainName.ToString()) : null, "blobDomainName" ,container.Add ); + AddIf( null != (((object)this._accountType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._accountType.ToString()) : null, "accountType" ,container.Add ); + AddIf( null != (((object)this._storageAccountId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._storageAccountId.ToString()) : null, "storageAccountId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountList.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountList.PowerShell.cs new file mode 100644 index 000000000000..2343b84ee398 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Collection of all the Storage Accounts on the Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(StorageAccountListTypeConverter))] + public partial class StorageAccountList + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IStorageAccountList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountList(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.DataBoxEdge.Models.Api20220301.IStorageAccountList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountList(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.DataBoxEdge.Models.Api20220301.IStorageAccountList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountList(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.DataBoxEdge.Models.Api20220301.IStorageAccountListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountListInternal)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 StorageAccountList(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.DataBoxEdge.Models.Api20220301.IStorageAccountListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountListInternal)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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of all the Storage Accounts on the Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(StorageAccountListTypeConverter))] + public partial interface IStorageAccountList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountList.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountList.TypeConverter.cs new file mode 100644 index 000000000000..ea8c4f6ba2e0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountListTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IStorageAccountList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountList.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/databoxedge/generated/api/Models/Api20220301/StorageAccountList.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountList.cs new file mode 100644 index 000000000000..d665538a0c95 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountList.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Collection of all the Storage Accounts on the Data Box Edge/Gateway device. + public partial class StorageAccountList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountList, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountListInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount[] _value; + + /// The list of storageAccounts. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount[] Value { get => this._value; } + + /// Creates an new instance. + public StorageAccountList() + { + + } + } + /// Collection of all the Storage Accounts on the Data Box Edge/Gateway device. + public partial interface IStorageAccountList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Link to the next set of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of storageAccounts. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of storageAccounts.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount[] Value { get; } + + } + /// Collection of all the Storage Accounts on the Data Box Edge/Gateway device. + internal partial interface IStorageAccountListInternal + + { + /// Link to the next set of results. + string NextLink { get; set; } + /// The list of storageAccounts. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountList.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountList.json.cs new file mode 100644 index 000000000000..cfd7353375ab --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountList.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Collection of all the Storage Accounts on the Data Box Edge/Gateway device. + public partial class StorageAccountList + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new StorageAccountList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountList(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IStorageAccount) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccount.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/StorageAccountProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountProperties.PowerShell.cs new file mode 100644 index 000000000000..41fe2532f854 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The storage account properties. + [System.ComponentModel.TypeConverter(typeof(StorageAccountPropertiesTypeConverter))] + public partial class StorageAccountProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IStorageAccountProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountProperties(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.DataBoxEdge.Models.Api20220301.IStorageAccountProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountProperties(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.DataBoxEdge.Models.Api20220301.IStorageAccountProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountProperties(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.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).StorageAccountStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus?) content.GetValueForProperty("StorageAccountStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).StorageAccountStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus.CreateFrom); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy.CreateFrom); + } + if (content.Contains("StorageAccountCredentialId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).StorageAccountCredentialId = (string) content.GetValueForProperty("StorageAccountCredentialId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).StorageAccountCredentialId, global::System.Convert.ToString); + } + if (content.Contains("BlobEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).BlobEndpoint = (string) content.GetValueForProperty("BlobEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).BlobEndpoint, global::System.Convert.ToString); + } + if (content.Contains("ContainerCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).ContainerCount = (int?) content.GetValueForProperty("ContainerCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).ContainerCount, (__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 StorageAccountProperties(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.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).StorageAccountStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus?) content.GetValueForProperty("StorageAccountStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).StorageAccountStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus.CreateFrom); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy.CreateFrom); + } + if (content.Contains("StorageAccountCredentialId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).StorageAccountCredentialId = (string) content.GetValueForProperty("StorageAccountCredentialId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).StorageAccountCredentialId, global::System.Convert.ToString); + } + if (content.Contains("BlobEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).BlobEndpoint = (string) content.GetValueForProperty("BlobEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).BlobEndpoint, global::System.Convert.ToString); + } + if (content.Contains("ContainerCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).ContainerCount = (int?) content.GetValueForProperty("ContainerCount",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal)this).ContainerCount, (__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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The storage account properties. + [System.ComponentModel.TypeConverter(typeof(StorageAccountPropertiesTypeConverter))] + public partial interface IStorageAccountProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountProperties.TypeConverter.cs new file mode 100644 index 000000000000..910ed52adbc1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountPropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IStorageAccountProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountProperties.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/databoxedge/generated/api/Models/Api20220301/StorageAccountProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountProperties.cs new file mode 100644 index 000000000000..2e36651c64da --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The storage account properties. + public partial class StorageAccountProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal + { + + /// Backing field for property. + private string _blobEndpoint; + + /// BlobEndpoint of Storage Account + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string BlobEndpoint { get => this._blobEndpoint; } + + /// Backing field for property. + private int? _containerCount; + + /// + /// The Container Count. Present only for Storage Accounts with DataPolicy set to Cloud. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? ContainerCount { get => this._containerCount; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy _dataPolicy; + + /// Data policy of the storage Account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy DataPolicy { get => this._dataPolicy; set => this._dataPolicy = value; } + + /// Backing field for property. + private string _description; + + /// Description for the storage Account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Internal Acessors for BlobEndpoint + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal.BlobEndpoint { get => this._blobEndpoint; set { {_blobEndpoint = value;} } } + + /// Internal Acessors for ContainerCount + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountPropertiesInternal.ContainerCount { get => this._containerCount; set { {_containerCount = value;} } } + + /// Backing field for property. + private string _storageAccountCredentialId; + + /// Storage Account Credential Id + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string StorageAccountCredentialId { get => this._storageAccountCredentialId; set => this._storageAccountCredentialId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus? _storageAccountStatus; + + /// Current status of the storage account + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus? StorageAccountStatus { get => this._storageAccountStatus; set => this._storageAccountStatus = value; } + + /// Creates an new instance. + public StorageAccountProperties() + { + + } + } + /// The storage account properties. + public partial interface IStorageAccountProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// BlobEndpoint of Storage Account + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"BlobEndpoint of Storage Account", + SerializedName = @"blobEndpoint", + PossibleTypes = new [] { typeof(string) })] + string BlobEndpoint { get; } + /// + /// The Container Count. Present only for Storage Accounts with DataPolicy set to Cloud. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Container Count. Present only for Storage Accounts with DataPolicy set to Cloud.", + SerializedName = @"containerCount", + PossibleTypes = new [] { typeof(int) })] + int? ContainerCount { get; } + /// Data policy of the storage Account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data policy of the storage Account.", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy DataPolicy { get; set; } + /// Description for the storage Account. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description for the storage Account.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Storage Account Credential Id + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Credential Id", + SerializedName = @"storageAccountCredentialId", + PossibleTypes = new [] { typeof(string) })] + string StorageAccountCredentialId { get; set; } + /// Current status of the storage account + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Current status of the storage account", + SerializedName = @"storageAccountStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus? StorageAccountStatus { get; set; } + + } + /// The storage account properties. + internal partial interface IStorageAccountPropertiesInternal + + { + /// BlobEndpoint of Storage Account + string BlobEndpoint { get; set; } + /// + /// The Container Count. Present only for Storage Accounts with DataPolicy set to Cloud. + /// + int? ContainerCount { get; set; } + /// Data policy of the storage Account. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy DataPolicy { get; set; } + /// Description for the storage Account. + string Description { get; set; } + /// Storage Account Credential Id + string StorageAccountCredentialId { get; set; } + /// Current status of the storage account + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus? StorageAccountStatus { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountProperties.json.cs new file mode 100644 index 000000000000..2435cd0f29a7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/StorageAccountProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The storage account properties. + public partial class StorageAccountProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new StorageAccountProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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;} + {_storageAccountStatus = If( json?.PropertyT("storageAccountStatus"), out var __jsonStorageAccountStatus) ? (string)__jsonStorageAccountStatus : (string)StorageAccountStatus;} + {_dataPolicy = If( json?.PropertyT("dataPolicy"), out var __jsonDataPolicy) ? (string)__jsonDataPolicy : (string)DataPolicy;} + {_storageAccountCredentialId = If( json?.PropertyT("storageAccountCredentialId"), out var __jsonStorageAccountCredentialId) ? (string)__jsonStorageAccountCredentialId : (string)StorageAccountCredentialId;} + {_blobEndpoint = If( json?.PropertyT("blobEndpoint"), out var __jsonBlobEndpoint) ? (string)__jsonBlobEndpoint : (string)BlobEndpoint;} + {_containerCount = If( json?.PropertyT("containerCount"), out var __jsonContainerCount) ? (int?)__jsonContainerCount : ContainerCount;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._storageAccountStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._storageAccountStatus.ToString()) : null, "storageAccountStatus" ,container.Add ); + AddIf( null != (((object)this._dataPolicy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._dataPolicy.ToString()) : null, "dataPolicy" ,container.Add ); + AddIf( null != (((object)this._storageAccountCredentialId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._storageAccountCredentialId.ToString()) : null, "storageAccountCredentialId" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._blobEndpoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._blobEndpoint.ToString()) : null, "blobEndpoint" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._containerCount ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._containerCount) : null, "containerCount" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionProperties.PowerShell.cs new file mode 100644 index 000000000000..c1ee1a7bb8ab --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionProperties.PowerShell.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(SubscriptionPropertiesTypeConverter))] + public partial class SubscriptionProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.ISubscriptionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SubscriptionProperties(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.DataBoxEdge.Models.Api20220301.ISubscriptionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SubscriptionProperties(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.DataBoxEdge.Models.Api20220301.ISubscriptionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SubscriptionProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("LocationPlacementId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).LocationPlacementId = (string) content.GetValueForProperty("LocationPlacementId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).LocationPlacementId, global::System.Convert.ToString); + } + if (content.Contains("QuotaId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).QuotaId = (string) content.GetValueForProperty("QuotaId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).QuotaId, global::System.Convert.ToString); + } + if (content.Contains("SerializedDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).SerializedDetail = (string) content.GetValueForProperty("SerializedDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).SerializedDetail, global::System.Convert.ToString); + } + if (content.Contains("RegisteredFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).RegisteredFeature = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[]) content.GetValueForProperty("RegisteredFeature",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).RegisteredFeature, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionRegisteredFeaturesTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SubscriptionProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("LocationPlacementId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).LocationPlacementId = (string) content.GetValueForProperty("LocationPlacementId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).LocationPlacementId, global::System.Convert.ToString); + } + if (content.Contains("QuotaId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).QuotaId = (string) content.GetValueForProperty("QuotaId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).QuotaId, global::System.Convert.ToString); + } + if (content.Contains("SerializedDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).SerializedDetail = (string) content.GetValueForProperty("SerializedDetail",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).SerializedDetail, global::System.Convert.ToString); + } + if (content.Contains("RegisteredFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).RegisteredFeature = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[]) content.GetValueForProperty("RegisteredFeature",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal)this).RegisteredFeature, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionRegisteredFeaturesTypeConverter.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(SubscriptionPropertiesTypeConverter))] + public partial interface ISubscriptionProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionProperties.TypeConverter.cs new file mode 100644 index 000000000000..917cc12653c7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SubscriptionPropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ISubscriptionProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SubscriptionProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SubscriptionProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SubscriptionProperties.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/databoxedge/generated/api/Models/Api20220301/SubscriptionProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionProperties.cs new file mode 100644 index 000000000000..1ab38d5a101d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + public partial class SubscriptionProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionPropertiesInternal + { + + /// Backing field for property. + private string _locationPlacementId; + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string LocationPlacementId { get => this._locationPlacementId; set => this._locationPlacementId = value; } + + /// Backing field for property. + private string _quotaId; + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string QuotaId { get => this._quotaId; set => this._quotaId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] _registeredFeature; + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get => this._registeredFeature; set => this._registeredFeature = value; } + + /// Backing field for property. + private string _serializedDetail; + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string SerializedDetail { get => this._serializedDetail; set => this._serializedDetail = value; } + + /// Backing field for property. + private string _tenantId; + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string TenantId { get => this._tenantId; set => this._tenantId = value; } + + /// Creates an new instance. + public SubscriptionProperties() + { + + } + } + public partial interface ISubscriptionProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"locationPlacementId", + PossibleTypes = new [] { typeof(string) })] + string LocationPlacementId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"quotaId", + PossibleTypes = new [] { typeof(string) })] + string QuotaId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"registeredFeatures", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"serializedDetails", + PossibleTypes = new [] { typeof(string) })] + string SerializedDetail { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; set; } + + } + internal partial interface ISubscriptionPropertiesInternal + + { + string LocationPlacementId { get; set; } + + string QuotaId { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures[] RegisteredFeature { get; set; } + + string SerializedDetail { get; set; } + + string TenantId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionProperties.json.cs new file mode 100644 index 000000000000..ecf4282eb9dd --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + public partial class SubscriptionProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new SubscriptionProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal SubscriptionProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} + {_locationPlacementId = If( json?.PropertyT("locationPlacementId"), out var __jsonLocationPlacementId) ? (string)__jsonLocationPlacementId : (string)LocationPlacementId;} + {_quotaId = If( json?.PropertyT("quotaId"), out var __jsonQuotaId) ? (string)__jsonQuotaId : (string)QuotaId;} + {_serializedDetail = If( json?.PropertyT("serializedDetails"), out var __jsonSerializedDetails) ? (string)__jsonSerializedDetails : (string)SerializedDetail;} + {_registeredFeature = If( json?.PropertyT("registeredFeatures"), out var __jsonRegisteredFeatures) ? If( __jsonRegisteredFeatures as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SubscriptionRegisteredFeatures.FromJson(__u) )) ))() : null : RegisteredFeature;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); + AddIf( null != (((object)this._locationPlacementId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._locationPlacementId.ToString()) : null, "locationPlacementId" ,container.Add ); + AddIf( null != (((object)this._quotaId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._quotaId.ToString()) : null, "quotaId" ,container.Add ); + AddIf( null != (((object)this._serializedDetail)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._serializedDetail.ToString()) : null, "serializedDetails" ,container.Add ); + if (null != this._registeredFeature) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._registeredFeature ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("registeredFeatures",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionRegisteredFeatures.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionRegisteredFeatures.PowerShell.cs new file mode 100644 index 000000000000..b307771887d8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionRegisteredFeatures.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(SubscriptionRegisteredFeaturesTypeConverter))] + public partial class SubscriptionRegisteredFeatures + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SubscriptionRegisteredFeatures(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.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SubscriptionRegisteredFeatures(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.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SubscriptionRegisteredFeatures(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.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeaturesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeaturesInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeaturesInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeaturesInternal)this).State, 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 SubscriptionRegisteredFeatures(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.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeaturesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeaturesInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeaturesInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeaturesInternal)this).State, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(SubscriptionRegisteredFeaturesTypeConverter))] + public partial interface ISubscriptionRegisteredFeatures + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionRegisteredFeatures.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionRegisteredFeatures.TypeConverter.cs new file mode 100644 index 000000000000..b2192dbc059a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionRegisteredFeatures.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SubscriptionRegisteredFeaturesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SubscriptionRegisteredFeatures.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SubscriptionRegisteredFeatures.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SubscriptionRegisteredFeatures.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/databoxedge/generated/api/Models/Api20220301/SubscriptionRegisteredFeatures.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionRegisteredFeatures.cs new file mode 100644 index 000000000000..3f6307e81db6 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionRegisteredFeatures.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + public partial class SubscriptionRegisteredFeatures : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeaturesInternal + { + + /// Backing field for property. + private string _name; + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _state; + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string State { get => this._state; set => this._state = value; } + + /// Creates an new instance. + public SubscriptionRegisteredFeatures() + { + + } + } + public partial interface ISubscriptionRegisteredFeatures : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"state", + PossibleTypes = new [] { typeof(string) })] + string State { get; set; } + + } + internal partial interface ISubscriptionRegisteredFeaturesInternal + + { + string Name { get; set; } + + string State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionRegisteredFeatures.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionRegisteredFeatures.json.cs new file mode 100644 index 000000000000..2d27a9aab9cd --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SubscriptionRegisteredFeatures.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + public partial class SubscriptionRegisteredFeatures + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISubscriptionRegisteredFeatures FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new SubscriptionRegisteredFeatures(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal SubscriptionRegisteredFeatures(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SupportPackageRequestProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SupportPackageRequestProperties.PowerShell.cs new file mode 100644 index 000000000000..38cd48165961 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SupportPackageRequestProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The share properties. + [System.ComponentModel.TypeConverter(typeof(SupportPackageRequestPropertiesTypeConverter))] + public partial class SupportPackageRequestProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.ISupportPackageRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SupportPackageRequestProperties(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.DataBoxEdge.Models.Api20220301.ISupportPackageRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SupportPackageRequestProperties(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.DataBoxEdge.Models.Api20220301.ISupportPackageRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SupportPackageRequestProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MinimumTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestPropertiesInternal)this).MinimumTimeStamp = (global::System.DateTime?) content.GetValueForProperty("MinimumTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestPropertiesInternal)this).MinimumTimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MaximumTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestPropertiesInternal)this).MaximumTimeStamp = (global::System.DateTime?) content.GetValueForProperty("MaximumTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestPropertiesInternal)this).MaximumTimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Include")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestPropertiesInternal)this).Include = (string) content.GetValueForProperty("Include",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestPropertiesInternal)this).Include, 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 SupportPackageRequestProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MinimumTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestPropertiesInternal)this).MinimumTimeStamp = (global::System.DateTime?) content.GetValueForProperty("MinimumTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestPropertiesInternal)this).MinimumTimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MaximumTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestPropertiesInternal)this).MaximumTimeStamp = (global::System.DateTime?) content.GetValueForProperty("MaximumTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestPropertiesInternal)this).MaximumTimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Include")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestPropertiesInternal)this).Include = (string) content.GetValueForProperty("Include",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestPropertiesInternal)this).Include, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The share properties. + [System.ComponentModel.TypeConverter(typeof(SupportPackageRequestPropertiesTypeConverter))] + public partial interface ISupportPackageRequestProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SupportPackageRequestProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SupportPackageRequestProperties.TypeConverter.cs new file mode 100644 index 000000000000..f9cc99d6aaf6 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SupportPackageRequestProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SupportPackageRequestPropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ISupportPackageRequestProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SupportPackageRequestProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SupportPackageRequestProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SupportPackageRequestProperties.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/databoxedge/generated/api/Models/Api20220301/SupportPackageRequestProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SupportPackageRequestProperties.cs new file mode 100644 index 000000000000..75ad337f51a4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SupportPackageRequestProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The share properties. + public partial class SupportPackageRequestProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestPropertiesInternal + { + + /// Backing field for property. + private string _include; + + /// + /// Type of files, which need to be included in the logs + /// This will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) + /// or a comma separated list of log types that are required + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Include { get => this._include; set => this._include = value; } + + /// Backing field for property. + private global::System.DateTime? _maximumTimeStamp; + + /// Start of the timespan of the log collection + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? MaximumTimeStamp { get => this._maximumTimeStamp; set => this._maximumTimeStamp = value; } + + /// Backing field for property. + private global::System.DateTime? _minimumTimeStamp; + + /// MinimumTimeStamp from where logs need to be collected + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? MinimumTimeStamp { get => this._minimumTimeStamp; set => this._minimumTimeStamp = value; } + + /// Creates an new instance. + public SupportPackageRequestProperties() + { + + } + } + /// The share properties. + public partial interface ISupportPackageRequestProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// + /// Type of files, which need to be included in the logs + /// This will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) + /// or a comma separated list of log types that are required + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of files, which need to be included in the logs + This will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) + or a comma separated list of log types that are required", + SerializedName = @"include", + PossibleTypes = new [] { typeof(string) })] + string Include { get; set; } + /// Start of the timespan of the log collection + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start of the timespan of the log collection", + SerializedName = @"maximumTimeStamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? MaximumTimeStamp { get; set; } + /// MinimumTimeStamp from where logs need to be collected + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"MinimumTimeStamp from where logs need to be collected", + SerializedName = @"minimumTimeStamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? MinimumTimeStamp { get; set; } + + } + /// The share properties. + internal partial interface ISupportPackageRequestPropertiesInternal + + { + /// + /// Type of files, which need to be included in the logs + /// This will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) + /// or a comma separated list of log types that are required + /// + string Include { get; set; } + /// Start of the timespan of the log collection + global::System.DateTime? MaximumTimeStamp { get; set; } + /// MinimumTimeStamp from where logs need to be collected + global::System.DateTime? MinimumTimeStamp { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SupportPackageRequestProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SupportPackageRequestProperties.json.cs new file mode 100644 index 000000000000..0874a91e738e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SupportPackageRequestProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The share properties. + public partial class SupportPackageRequestProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new SupportPackageRequestProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal SupportPackageRequestProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_minimumTimeStamp = If( json?.PropertyT("minimumTimeStamp"), out var __jsonMinimumTimeStamp) ? global::System.DateTime.TryParse((string)__jsonMinimumTimeStamp, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonMinimumTimeStampValue) ? __jsonMinimumTimeStampValue : MinimumTimeStamp : MinimumTimeStamp;} + {_maximumTimeStamp = If( json?.PropertyT("maximumTimeStamp"), out var __jsonMaximumTimeStamp) ? global::System.DateTime.TryParse((string)__jsonMaximumTimeStamp, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonMaximumTimeStampValue) ? __jsonMaximumTimeStampValue : MaximumTimeStamp : MaximumTimeStamp;} + {_include = If( json?.PropertyT("include"), out var __jsonInclude) ? (string)__jsonInclude : (string)Include;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._minimumTimeStamp ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._minimumTimeStamp?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "minimumTimeStamp" ,container.Add ); + AddIf( null != this._maximumTimeStamp ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._maximumTimeStamp?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "maximumTimeStamp" ,container.Add ); + AddIf( null != (((object)this._include)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._include.ToString()) : null, "include" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SymmetricKey.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SymmetricKey.PowerShell.cs new file mode 100644 index 000000000000..7ee8a55199a3 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SymmetricKey.PowerShell.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Symmetric key for authentication. + [System.ComponentModel.TypeConverter(typeof(SymmetricKeyTypeConverter))] + public partial class SymmetricKey + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.ISymmetricKey DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SymmetricKey(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.DataBoxEdge.Models.Api20220301.ISymmetricKey DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SymmetricKey(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.DataBoxEdge.Models.Api20220301.ISymmetricKey FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SymmetricKey(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)this).ConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)this).ConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)this).ConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("ConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)this).ConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("ConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)this).ConnectionStringValue = (string) content.GetValueForProperty("ConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)this).ConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("ConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)this).ConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("ConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)this).ConnectionStringEncryptionCertThumbprint, 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 SymmetricKey(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)this).ConnectionString = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)this).ConnectionString, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ConnectionStringEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)this).ConnectionStringEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("ConnectionStringEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)this).ConnectionStringEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("ConnectionStringValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)this).ConnectionStringValue = (string) content.GetValueForProperty("ConnectionStringValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)this).ConnectionStringValue, global::System.Convert.ToString); + } + if (content.Contains("ConnectionStringEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)this).ConnectionStringEncryptionCertThumbprint = (string) content.GetValueForProperty("ConnectionStringEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal)this).ConnectionStringEncryptionCertThumbprint, 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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Symmetric key for authentication. + [System.ComponentModel.TypeConverter(typeof(SymmetricKeyTypeConverter))] + public partial interface ISymmetricKey + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SymmetricKey.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SymmetricKey.TypeConverter.cs new file mode 100644 index 000000000000..d26c6f276b57 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SymmetricKey.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SymmetricKeyTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ISymmetricKey ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SymmetricKey.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SymmetricKey.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SymmetricKey.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/databoxedge/generated/api/Models/Api20220301/SymmetricKey.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SymmetricKey.cs new file mode 100644 index 000000000000..35d9ca585b93 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SymmetricKey.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Symmetric key for authentication. + public partial class SymmetricKey : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret _connectionString; + + /// Connection string based on the symmetric key. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret ConnectionString { get => (this._connectionString = this._connectionString ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret()); set => this._connectionString = value; } + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? ConnectionStringEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)ConnectionString).EncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)ConnectionString).EncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ConnectionStringEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)ConnectionString).EncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)ConnectionString).EncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string ConnectionStringValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)ConnectionString).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)ConnectionString).Value = value ?? null; } + + /// Internal Acessors for ConnectionString + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKeyInternal.ConnectionString { get => (this._connectionString = this._connectionString ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret()); set { {_connectionString = value;} } } + + /// Creates an new instance. + public SymmetricKey() + { + + } + } + /// Symmetric key for authentication. + public partial interface ISymmetricKey : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? ConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string ConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string ConnectionStringValue { get; set; } + + } + /// Symmetric key for authentication. + internal partial interface ISymmetricKeyInternal + + { + /// Connection string based on the symmetric key. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret ConnectionString { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? ConnectionStringEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string ConnectionStringEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string ConnectionStringValue { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/SymmetricKey.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/SymmetricKey.json.cs new file mode 100644 index 000000000000..960e823fc5ec --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/SymmetricKey.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Symmetric key for authentication. + public partial class SymmetricKey + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISymmetricKey FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new SymmetricKey(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal SymmetricKey(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_connectionString = If( json?.PropertyT("connectionString"), out var __jsonConnectionString) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret.FromJson(__jsonConnectionString) : ConnectionString;} + 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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._connectionString ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._connectionString.ToJson(null,serializationMode) : null, "connectionString" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/TrackingInfo.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/TrackingInfo.PowerShell.cs new file mode 100644 index 000000000000..c1a4572149e8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/TrackingInfo.PowerShell.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Tracking courier information. + [System.ComponentModel.TypeConverter(typeof(TrackingInfoTypeConverter))] + public partial class TrackingInfo + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.ITrackingInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrackingInfo(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.DataBoxEdge.Models.Api20220301.ITrackingInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrackingInfo(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.DataBoxEdge.Models.Api20220301.ITrackingInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TrackingInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("CarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)this).CarrierName = (string) content.GetValueForProperty("CarrierName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)this).CarrierName, global::System.Convert.ToString); + } + if (content.Contains("TrackingId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)this).TrackingId = (string) content.GetValueForProperty("TrackingId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)this).TrackingId, global::System.Convert.ToString); + } + if (content.Contains("TrackingUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)this).TrackingUrl = (string) content.GetValueForProperty("TrackingUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)this).TrackingUrl, 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 TrackingInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("CarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)this).CarrierName = (string) content.GetValueForProperty("CarrierName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)this).CarrierName, global::System.Convert.ToString); + } + if (content.Contains("TrackingId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)this).TrackingId = (string) content.GetValueForProperty("TrackingId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)this).TrackingId, global::System.Convert.ToString); + } + if (content.Contains("TrackingUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)this).TrackingUrl = (string) content.GetValueForProperty("TrackingUrl",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal)this).TrackingUrl, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Tracking courier information. + [System.ComponentModel.TypeConverter(typeof(TrackingInfoTypeConverter))] + public partial interface ITrackingInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/TrackingInfo.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/TrackingInfo.TypeConverter.cs new file mode 100644 index 000000000000..9879d97d7312 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/TrackingInfo.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TrackingInfoTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ITrackingInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TrackingInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TrackingInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TrackingInfo.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/databoxedge/generated/api/Models/Api20220301/TrackingInfo.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/TrackingInfo.cs new file mode 100644 index 000000000000..315225ec7be8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/TrackingInfo.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Tracking courier information. + public partial class TrackingInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfoInternal + { + + /// Backing field for property. + private string _carrierName; + + /// Name of the carrier used in the delivery. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string CarrierName { get => this._carrierName; set => this._carrierName = value; } + + /// Backing field for property. + private string _serialNumber; + + /// Serial number of the device being tracked. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string SerialNumber { get => this._serialNumber; set => this._serialNumber = value; } + + /// Backing field for property. + private string _trackingId; + + /// Tracking ID of the shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string TrackingId { get => this._trackingId; set => this._trackingId = value; } + + /// Backing field for property. + private string _trackingUrl; + + /// Tracking URL of the shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string TrackingUrl { get => this._trackingUrl; set => this._trackingUrl = value; } + + /// Creates an new instance. + public TrackingInfo() + { + + } + } + /// Tracking courier information. + public partial interface ITrackingInfo : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Name of the carrier used in the delivery. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the carrier used in the delivery.", + SerializedName = @"carrierName", + PossibleTypes = new [] { typeof(string) })] + string CarrierName { get; set; } + /// Serial number of the device being tracked. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Serial number of the device being tracked.", + SerializedName = @"serialNumber", + PossibleTypes = new [] { typeof(string) })] + string SerialNumber { get; set; } + /// Tracking ID of the shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tracking ID of the shipment.", + SerializedName = @"trackingId", + PossibleTypes = new [] { typeof(string) })] + string TrackingId { get; set; } + /// Tracking URL of the shipment. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tracking URL of the shipment.", + SerializedName = @"trackingUrl", + PossibleTypes = new [] { typeof(string) })] + string TrackingUrl { get; set; } + + } + /// Tracking courier information. + internal partial interface ITrackingInfoInternal + + { + /// Name of the carrier used in the delivery. + string CarrierName { get; set; } + /// Serial number of the device being tracked. + string SerialNumber { get; set; } + /// Tracking ID of the shipment. + string TrackingId { get; set; } + /// Tracking URL of the shipment. + string TrackingUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/TrackingInfo.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/TrackingInfo.json.cs new file mode 100644 index 000000000000..795a375cac41 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/TrackingInfo.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Tracking courier information. + public partial class TrackingInfo + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrackingInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new TrackingInfo(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._serialNumber)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._serialNumber.ToString()) : null, "serialNumber" ,container.Add ); + AddIf( null != (((object)this._carrierName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._carrierName.ToString()) : null, "carrierName" ,container.Add ); + AddIf( null != (((object)this._trackingId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._trackingId.ToString()) : null, "trackingId" ,container.Add ); + AddIf( null != (((object)this._trackingUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._trackingUrl.ToString()) : null, "trackingUrl" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal TrackingInfo(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_serialNumber = If( json?.PropertyT("serialNumber"), out var __jsonSerialNumber) ? (string)__jsonSerialNumber : (string)SerialNumber;} + {_carrierName = If( json?.PropertyT("carrierName"), out var __jsonCarrierName) ? (string)__jsonCarrierName : (string)CarrierName;} + {_trackingId = If( json?.PropertyT("trackingId"), out var __jsonTrackingId) ? (string)__jsonTrackingId : (string)TrackingId;} + {_trackingUrl = If( json?.PropertyT("trackingUrl"), out var __jsonTrackingUrl) ? (string)__jsonTrackingUrl : (string)TrackingUrl;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Trigger.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Trigger.PowerShell.cs new file mode 100644 index 000000000000..ba06102a188f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Trigger.PowerShell.cs @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Trigger details. + [System.ComponentModel.TypeConverter(typeof(TriggerTypeConverter))] + public partial class Trigger + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.ITrigger DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Trigger(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.DataBoxEdge.Models.Api20220301.ITrigger DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Trigger(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.DataBoxEdge.Models.Api20220301.ITrigger FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Trigger(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedAt, (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 Trigger(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + } + /// Trigger details. + [System.ComponentModel.TypeConverter(typeof(TriggerTypeConverter))] + public partial interface ITrigger + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Trigger.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Trigger.TypeConverter.cs new file mode 100644 index 000000000000..7a21e7748b4b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Trigger.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TriggerTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ITrigger ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Trigger.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Trigger.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Trigger.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/databoxedge/generated/api/Models/Api20220301/Trigger.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Trigger.cs new file mode 100644 index 000000000000..540c9b499557 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Trigger.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Trigger details. + public partial class Trigger : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType _kind; + + /// Trigger Kind. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType Kind { get => this._kind; set => this._kind = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of Trigger + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Creates an new instance. + public Trigger() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// Trigger details. + public partial interface ITrigger : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// Trigger Kind. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Trigger Kind.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType Kind { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// Trigger details. + internal partial interface ITriggerInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// Trigger Kind. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType Kind { get; set; } + /// Metadata pertaining to creation and last modification of Trigger + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/Trigger.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/Trigger.json.cs new file mode 100644 index 000000000000..cea2e2ef2d44 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/Trigger.json.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Trigger details. + public partial class Trigger + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger interface is polymorphic, and the + /// precise model class that will get deserialized is determined at runtime based on the payload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + if (!(node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json)) + { + return null; + } + // Polymorphic type -- select the appropriate constructor using the discriminator + + switch ( json.StringProperty("kind") ) + { + case "FileEvent": + { + return new FileEventTrigger(json); + } + case "PeriodicTimerEvent": + { + return new PeriodicTimerEventTrigger(json); + } + } + return new Trigger(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal Trigger(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerList.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerList.PowerShell.cs new file mode 100644 index 000000000000..f4468148190c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Collection of all trigger on the data box edge device. + [System.ComponentModel.TypeConverter(typeof(TriggerListTypeConverter))] + public partial class TriggerList + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.ITriggerList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TriggerList(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.DataBoxEdge.Models.Api20220301.ITriggerList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TriggerList(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.DataBoxEdge.Models.Api20220301.ITriggerList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TriggerList(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.DataBoxEdge.Models.Api20220301.ITriggerListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TriggerTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerListInternal)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 TriggerList(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.DataBoxEdge.Models.Api20220301.ITriggerListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TriggerTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Collection of all trigger on the data box edge device. + [System.ComponentModel.TypeConverter(typeof(TriggerListTypeConverter))] + public partial interface ITriggerList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerList.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerList.TypeConverter.cs new file mode 100644 index 000000000000..2b508f0ea1e2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TriggerListTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ITriggerList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TriggerList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TriggerList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TriggerList.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/databoxedge/generated/api/Models/Api20220301/TriggerList.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerList.cs new file mode 100644 index 000000000000..9e1db348526d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerList.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Collection of all trigger on the data box edge device. + public partial class TriggerList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerList, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerListInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger[] _value; + + /// The list of triggers. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger[] Value { get => this._value; } + + /// Creates an new instance. + public TriggerList() + { + + } + } + /// Collection of all trigger on the data box edge device. + public partial interface ITriggerList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Link to the next set of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of triggers. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of triggers.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger[] Value { get; } + + } + /// Collection of all trigger on the data box edge device. + internal partial interface ITriggerListInternal + + { + /// Link to the next set of results. + string NextLink { get; set; } + /// The list of triggers. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerList.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerList.json.cs new file mode 100644 index 000000000000..98257e41b871 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerList.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Collection of all trigger on the data box edge device. + public partial class TriggerList + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new TriggerList(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal TriggerList(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.ITrigger) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Trigger.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerSupportPackageRequest.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerSupportPackageRequest.PowerShell.cs new file mode 100644 index 000000000000..634e2651d445 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerSupportPackageRequest.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The request object for trigger support package. + [System.ComponentModel.TypeConverter(typeof(TriggerSupportPackageRequestTypeConverter))] + public partial class TriggerSupportPackageRequest + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TriggerSupportPackageRequest(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.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TriggerSupportPackageRequest(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.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TriggerSupportPackageRequest(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.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SupportPackageRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("MinimumTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequestInternal)this).MinimumTimeStamp = (global::System.DateTime?) content.GetValueForProperty("MinimumTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequestInternal)this).MinimumTimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MaximumTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequestInternal)this).MaximumTimeStamp = (global::System.DateTime?) content.GetValueForProperty("MaximumTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequestInternal)this).MaximumTimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Include")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequestInternal)this).Include = (string) content.GetValueForProperty("Include",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequestInternal)this).Include, 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 TriggerSupportPackageRequest(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.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SupportPackageRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("MinimumTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequestInternal)this).MinimumTimeStamp = (global::System.DateTime?) content.GetValueForProperty("MinimumTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequestInternal)this).MinimumTimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MaximumTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequestInternal)this).MaximumTimeStamp = (global::System.DateTime?) content.GetValueForProperty("MaximumTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequestInternal)this).MaximumTimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Include")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequestInternal)this).Include = (string) content.GetValueForProperty("Include",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequestInternal)this).Include, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// The request object for trigger support package. + [System.ComponentModel.TypeConverter(typeof(TriggerSupportPackageRequestTypeConverter))] + public partial interface ITriggerSupportPackageRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerSupportPackageRequest.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerSupportPackageRequest.TypeConverter.cs new file mode 100644 index 000000000000..0d9871a0733c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerSupportPackageRequest.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TriggerSupportPackageRequestTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TriggerSupportPackageRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TriggerSupportPackageRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TriggerSupportPackageRequest.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/databoxedge/generated/api/Models/Api20220301/TriggerSupportPackageRequest.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerSupportPackageRequest.cs new file mode 100644 index 000000000000..1f32029b0e76 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerSupportPackageRequest.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The request object for trigger support package. + public partial class TriggerSupportPackageRequest : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequestInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// + /// Type of files, which need to be included in the logs + /// This will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) + /// or a comma separated list of log types that are required + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Include { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestPropertiesInternal)Property).Include; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestPropertiesInternal)Property).Include = value ?? null; } + + /// Start of the timespan of the log collection + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? MaximumTimeStamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestPropertiesInternal)Property).MaximumTimeStamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestPropertiesInternal)Property).MaximumTimeStamp = value ?? default(global::System.DateTime); } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SupportPackageRequestProperties()); set { {_property = value;} } } + + /// MinimumTimeStamp from where logs need to be collected + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? MinimumTimeStamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestPropertiesInternal)Property).MinimumTimeStamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestPropertiesInternal)Property).MinimumTimeStamp = value ?? default(global::System.DateTime); } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestProperties _property; + + /// The TriggerSupportPackageRequest properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SupportPackageRequestProperties()); set => this._property = value; } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Creates an new instance. + public TriggerSupportPackageRequest() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// The request object for trigger support package. + public partial interface ITriggerSupportPackageRequest : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// + /// Type of files, which need to be included in the logs + /// This will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) + /// or a comma separated list of log types that are required + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of files, which need to be included in the logs + This will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) + or a comma separated list of log types that are required", + SerializedName = @"include", + PossibleTypes = new [] { typeof(string) })] + string Include { get; set; } + /// Start of the timespan of the log collection + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start of the timespan of the log collection", + SerializedName = @"maximumTimeStamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? MaximumTimeStamp { get; set; } + /// MinimumTimeStamp from where logs need to be collected + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"MinimumTimeStamp from where logs need to be collected", + SerializedName = @"minimumTimeStamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? MinimumTimeStamp { get; set; } + + } + /// The request object for trigger support package. + internal partial interface ITriggerSupportPackageRequestInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// + /// Type of files, which need to be included in the logs + /// This will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) + /// or a comma separated list of log types that are required + /// + string Include { get; set; } + /// Start of the timespan of the log collection + global::System.DateTime? MaximumTimeStamp { get; set; } + /// MinimumTimeStamp from where logs need to be collected + global::System.DateTime? MinimumTimeStamp { get; set; } + /// The TriggerSupportPackageRequest properties. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISupportPackageRequestProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerSupportPackageRequest.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerSupportPackageRequest.json.cs new file mode 100644 index 000000000000..7a54ca55befa --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/TriggerSupportPackageRequest.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The request object for trigger support package. + public partial class TriggerSupportPackageRequest + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new TriggerSupportPackageRequest(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal TriggerSupportPackageRequest(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SupportPackageRequestProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDetails.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDetails.PowerShell.cs new file mode 100644 index 000000000000..55cb12036ac3 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDetails.PowerShell.cs @@ -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. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Update Specific attributes + [System.ComponentModel.TypeConverter(typeof(UpdateDetailsTypeConverter))] + public partial class UpdateDetails + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IUpdateDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UpdateDetails(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.DataBoxEdge.Models.Api20220301.IUpdateDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UpdateDetails(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.DataBoxEdge.Models.Api20220301.IUpdateDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UpdateDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("UpdateTitle")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).UpdateTitle = (string) content.GetValueForProperty("UpdateTitle",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).UpdateTitle, global::System.Convert.ToString); + } + if (content.Contains("UpdateSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).UpdateSize = (double?) content.GetValueForProperty("UpdateSize",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).UpdateSize, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("UpdateType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).UpdateType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateType?) content.GetValueForProperty("UpdateType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).UpdateType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateType.CreateFrom); + } + if (content.Contains("TargetVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).TargetVersion = (string) content.GetValueForProperty("TargetVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).TargetVersion, global::System.Convert.ToString); + } + if (content.Contains("FriendlyVersionNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).FriendlyVersionNumber = (string) content.GetValueForProperty("FriendlyVersionNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).FriendlyVersionNumber, global::System.Convert.ToString); + } + if (content.Contains("EstimatedInstallTimeInMin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).EstimatedInstallTimeInMin = (int?) content.GetValueForProperty("EstimatedInstallTimeInMin",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).EstimatedInstallTimeInMin, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RebootBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).RebootBehavior = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior?) content.GetValueForProperty("RebootBehavior",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).RebootBehavior, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior.CreateFrom); + } + if (content.Contains("InstallationImpact")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).InstallationImpact = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallationImpact?) content.GetValueForProperty("InstallationImpact",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).InstallationImpact, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallationImpact.CreateFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateStatus.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UpdateDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("UpdateTitle")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).UpdateTitle = (string) content.GetValueForProperty("UpdateTitle",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).UpdateTitle, global::System.Convert.ToString); + } + if (content.Contains("UpdateSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).UpdateSize = (double?) content.GetValueForProperty("UpdateSize",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).UpdateSize, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("UpdateType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).UpdateType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateType?) content.GetValueForProperty("UpdateType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).UpdateType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateType.CreateFrom); + } + if (content.Contains("TargetVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).TargetVersion = (string) content.GetValueForProperty("TargetVersion",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).TargetVersion, global::System.Convert.ToString); + } + if (content.Contains("FriendlyVersionNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).FriendlyVersionNumber = (string) content.GetValueForProperty("FriendlyVersionNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).FriendlyVersionNumber, global::System.Convert.ToString); + } + if (content.Contains("EstimatedInstallTimeInMin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).EstimatedInstallTimeInMin = (int?) content.GetValueForProperty("EstimatedInstallTimeInMin",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).EstimatedInstallTimeInMin, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RebootBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).RebootBehavior = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior?) content.GetValueForProperty("RebootBehavior",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).RebootBehavior, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior.CreateFrom); + } + if (content.Contains("InstallationImpact")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).InstallationImpact = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallationImpact?) content.GetValueForProperty("InstallationImpact",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).InstallationImpact, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallationImpact.CreateFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateStatus.CreateFrom); + } + AfterDeserializePSObject(content); + } + } + /// Update Specific attributes + [System.ComponentModel.TypeConverter(typeof(UpdateDetailsTypeConverter))] + public partial interface IUpdateDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDetails.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDetails.TypeConverter.cs new file mode 100644 index 000000000000..d1847f40569a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDetails.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UpdateDetailsTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IUpdateDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UpdateDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UpdateDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UpdateDetails.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/databoxedge/generated/api/Models/Api20220301/UpdateDetails.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDetails.cs new file mode 100644 index 000000000000..ae62165e9e6b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDetails.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Update Specific attributes + public partial class UpdateDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetailsInternal + { + + /// Backing field for property. + private int? _estimatedInstallTimeInMin; + + /// Estimated Install Time for the update + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? EstimatedInstallTimeInMin { get => this._estimatedInstallTimeInMin; set => this._estimatedInstallTimeInMin = value; } + + /// Backing field for property. + private string _friendlyVersionNumber; + + /// Friendly Version Number + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string FriendlyVersionNumber { get => this._friendlyVersionNumber; set => this._friendlyVersionNumber = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallationImpact? _installationImpact; + + /// Impact of Installing an updateType + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallationImpact? InstallationImpact { get => this._installationImpact; set => this._installationImpact = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior? _rebootBehavior; + + /// + /// Indicates if updates are available and at least one of the updates needs a reboot. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior? RebootBehavior { get => this._rebootBehavior; set => this._rebootBehavior = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateStatus? _status; + + /// Status of the update. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateStatus? Status { get => this._status; set => this._status = value; } + + /// Backing field for property. + private string _targetVersion; + + /// Target Version number + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string TargetVersion { get => this._targetVersion; set => this._targetVersion = value; } + + /// Backing field for property. + private double? _updateSize; + + /// Size of the update(In Bytes) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public double? UpdateSize { get => this._updateSize; set => this._updateSize = value; } + + /// Backing field for property. + private string _updateTitle; + + /// Title of the Update + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string UpdateTitle { get => this._updateTitle; set => this._updateTitle = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateType? _updateType; + + /// Type of the Update + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateType? UpdateType { get => this._updateType; set => this._updateType = value; } + + /// Creates an new instance. + public UpdateDetails() + { + + } + } + /// Update Specific attributes + public partial interface IUpdateDetails : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Estimated Install Time for the update + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Estimated Install Time for the update", + SerializedName = @"estimatedInstallTimeInMins", + PossibleTypes = new [] { typeof(int) })] + int? EstimatedInstallTimeInMin { get; set; } + /// Friendly Version Number + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly Version Number", + SerializedName = @"friendlyVersionNumber", + PossibleTypes = new [] { typeof(string) })] + string FriendlyVersionNumber { get; set; } + /// Impact of Installing an updateType + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Impact of Installing an updateType", + SerializedName = @"installationImpact", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallationImpact) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallationImpact? InstallationImpact { get; set; } + /// + /// Indicates if updates are available and at least one of the updates needs a reboot. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if updates are available and at least one of the updates needs a reboot.", + SerializedName = @"rebootBehavior", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior? RebootBehavior { get; set; } + /// Status of the update. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of the update.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateStatus? Status { get; set; } + /// Target Version number + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Target Version number", + SerializedName = @"targetVersion", + PossibleTypes = new [] { typeof(string) })] + string TargetVersion { get; set; } + /// Size of the update(In Bytes) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Size of the update(In Bytes)", + SerializedName = @"updateSize", + PossibleTypes = new [] { typeof(double) })] + double? UpdateSize { get; set; } + /// Title of the Update + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Title of the Update", + SerializedName = @"updateTitle", + PossibleTypes = new [] { typeof(string) })] + string UpdateTitle { get; set; } + /// Type of the Update + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the Update", + SerializedName = @"updateType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateType? UpdateType { get; set; } + + } + /// Update Specific attributes + internal partial interface IUpdateDetailsInternal + + { + /// Estimated Install Time for the update + int? EstimatedInstallTimeInMin { get; set; } + /// Friendly Version Number + string FriendlyVersionNumber { get; set; } + /// Impact of Installing an updateType + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallationImpact? InstallationImpact { get; set; } + /// + /// Indicates if updates are available and at least one of the updates needs a reboot. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior? RebootBehavior { get; set; } + /// Status of the update. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateStatus? Status { get; set; } + /// Target Version number + string TargetVersion { get; set; } + /// Size of the update(In Bytes) + double? UpdateSize { get; set; } + /// Title of the Update + string UpdateTitle { get; set; } + /// Type of the Update + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateType? UpdateType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDetails.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDetails.json.cs new file mode 100644 index 000000000000..3f6e8d2e61e8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDetails.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Update Specific attributes + public partial class UpdateDetails + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new UpdateDetails(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._updateTitle)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._updateTitle.ToString()) : null, "updateTitle" ,container.Add ); + AddIf( null != this._updateSize ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((double)this._updateSize) : null, "updateSize" ,container.Add ); + AddIf( null != (((object)this._updateType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._updateType.ToString()) : null, "updateType" ,container.Add ); + AddIf( null != (((object)this._targetVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._targetVersion.ToString()) : null, "targetVersion" ,container.Add ); + AddIf( null != (((object)this._friendlyVersionNumber)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._friendlyVersionNumber.ToString()) : null, "friendlyVersionNumber" ,container.Add ); + AddIf( null != this._estimatedInstallTimeInMin ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._estimatedInstallTimeInMin) : null, "estimatedInstallTimeInMins" ,container.Add ); + AddIf( null != (((object)this._rebootBehavior)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._rebootBehavior.ToString()) : null, "rebootBehavior" ,container.Add ); + AddIf( null != (((object)this._installationImpact)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._installationImpact.ToString()) : null, "installationImpact" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal UpdateDetails(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_updateTitle = If( json?.PropertyT("updateTitle"), out var __jsonUpdateTitle) ? (string)__jsonUpdateTitle : (string)UpdateTitle;} + {_updateSize = If( json?.PropertyT("updateSize"), out var __jsonUpdateSize) ? (double?)__jsonUpdateSize : UpdateSize;} + {_updateType = If( json?.PropertyT("updateType"), out var __jsonUpdateType) ? (string)__jsonUpdateType : (string)UpdateType;} + {_targetVersion = If( json?.PropertyT("targetVersion"), out var __jsonTargetVersion) ? (string)__jsonTargetVersion : (string)TargetVersion;} + {_friendlyVersionNumber = If( json?.PropertyT("friendlyVersionNumber"), out var __jsonFriendlyVersionNumber) ? (string)__jsonFriendlyVersionNumber : (string)FriendlyVersionNumber;} + {_estimatedInstallTimeInMin = If( json?.PropertyT("estimatedInstallTimeInMins"), out var __jsonEstimatedInstallTimeInMins) ? (int?)__jsonEstimatedInstallTimeInMins : EstimatedInstallTimeInMin;} + {_rebootBehavior = If( json?.PropertyT("rebootBehavior"), out var __jsonRebootBehavior) ? (string)__jsonRebootBehavior : (string)RebootBehavior;} + {_installationImpact = If( json?.PropertyT("installationImpact"), out var __jsonInstallationImpact) ? (string)__jsonInstallationImpact : (string)InstallationImpact;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDownloadProgress.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDownloadProgress.PowerShell.cs new file mode 100644 index 000000000000..795d133896f4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDownloadProgress.PowerShell.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Details about the download progress of update. + [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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgress FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).DownloadPhase = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase?) content.GetValueForProperty("DownloadPhase",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).DownloadPhase, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase.CreateFrom); + } + if (content.Contains("PercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).PercentComplete = (int?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).PercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalBytesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).TotalBytesToDownload = (double?) content.GetValueForProperty("TotalBytesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).TotalBytesToDownload, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("TotalBytesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).TotalBytesDownloaded = (double?) content.GetValueForProperty("TotalBytesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).TotalBytesDownloaded, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("NumberOfUpdatesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).NumberOfUpdatesToDownload = (int?) content.GetValueForProperty("NumberOfUpdatesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).NumberOfUpdatesToDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NumberOfUpdatesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).NumberOfUpdatesDownloaded = (int?) content.GetValueForProperty("NumberOfUpdatesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).DownloadPhase = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase?) content.GetValueForProperty("DownloadPhase",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).DownloadPhase, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase.CreateFrom); + } + if (content.Contains("PercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).PercentComplete = (int?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).PercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalBytesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).TotalBytesToDownload = (double?) content.GetValueForProperty("TotalBytesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).TotalBytesToDownload, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("TotalBytesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).TotalBytesDownloaded = (double?) content.GetValueForProperty("TotalBytesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).TotalBytesDownloaded, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("NumberOfUpdatesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).NumberOfUpdatesToDownload = (int?) content.GetValueForProperty("NumberOfUpdatesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).NumberOfUpdatesToDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NumberOfUpdatesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).NumberOfUpdatesDownloaded = (int?) content.GetValueForProperty("NumberOfUpdatesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal)this).NumberOfUpdatesDownloaded, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + } + /// Details about the download progress of update. + [System.ComponentModel.TypeConverter(typeof(UpdateDownloadProgressTypeConverter))] + public partial interface IUpdateDownloadProgress + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDownloadProgress.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDownloadProgress.TypeConverter.cs new file mode 100644 index 000000000000..e09b2c553163 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgress ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/UpdateDownloadProgress.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDownloadProgress.cs new file mode 100644 index 000000000000..13e02c20be86 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDownloadProgress.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Details about the download progress of update. + public partial class UpdateDownloadProgress : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgress, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase? _downloadPhase; + + /// The download phase. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase? DownloadPhase { get => this._downloadPhase; } + + /// Internal Acessors for DownloadPhase + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal.DownloadPhase { get => this._downloadPhase; set { {_downloadPhase = value;} } } + + /// Internal Acessors for NumberOfUpdatesDownloaded + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal.NumberOfUpdatesDownloaded { get => this._numberOfUpdatesDownloaded; set { {_numberOfUpdatesDownloaded = value;} } } + + /// Internal Acessors for NumberOfUpdatesToDownload + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal.NumberOfUpdatesToDownload { get => this._numberOfUpdatesToDownload; set { {_numberOfUpdatesToDownload = value;} } } + + /// Internal Acessors for PercentComplete + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal.PercentComplete { get => this._percentComplete; set { {_percentComplete = value;} } } + + /// Internal Acessors for TotalBytesDownloaded + double? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal.TotalBytesDownloaded { get => this._totalBytesDownloaded; set { {_totalBytesDownloaded = value;} } } + + /// Internal Acessors for TotalBytesToDownload + double? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgressInternal.TotalBytesToDownload { get => this._totalBytesToDownload; set { {_totalBytesToDownload = value;} } } + + /// Backing field for property. + private int? _numberOfUpdatesDownloaded; + + /// Number of updates downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? NumberOfUpdatesDownloaded { get => this._numberOfUpdatesDownloaded; } + + /// Backing field for property. + private int? _numberOfUpdatesToDownload; + + /// Number of updates to download. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? NumberOfUpdatesToDownload { get => this._numberOfUpdatesToDownload; } + + /// Backing field for property. + private int? _percentComplete; + + /// Percentage of completion. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? PercentComplete { get => this._percentComplete; } + + /// Backing field for property. + private double? _totalBytesDownloaded; + + /// Total bytes downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public double? TotalBytesDownloaded { get => this._totalBytesDownloaded; } + + /// Backing field for property. + private double? _totalBytesToDownload; + + /// Total bytes to download. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public double? TotalBytesToDownload { get => this._totalBytesToDownload; } + + /// Creates an new instance. + public UpdateDownloadProgress() + { + + } + } + /// Details about the download progress of update. + public partial interface IUpdateDownloadProgress : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The download phase. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The download phase.", + SerializedName = @"downloadPhase", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase? DownloadPhase { get; } + /// Number of updates downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of updates downloaded.", + SerializedName = @"numberOfUpdatesDownloaded", + PossibleTypes = new [] { typeof(int) })] + int? NumberOfUpdatesDownloaded { get; } + /// Number of updates to download. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of updates to download.", + SerializedName = @"numberOfUpdatesToDownload", + PossibleTypes = new [] { typeof(int) })] + int? NumberOfUpdatesToDownload { get; } + /// Percentage of completion. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Percentage of completion.", + SerializedName = @"percentComplete", + PossibleTypes = new [] { typeof(int) })] + int? PercentComplete { get; } + /// Total bytes downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total bytes downloaded.", + SerializedName = @"totalBytesDownloaded", + PossibleTypes = new [] { typeof(double) })] + double? TotalBytesDownloaded { get; } + /// Total bytes to download. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total bytes to download.", + SerializedName = @"totalBytesToDownload", + PossibleTypes = new [] { typeof(double) })] + double? TotalBytesToDownload { get; } + + } + /// Details about the download progress of update. + internal partial interface IUpdateDownloadProgressInternal + + { + /// The download phase. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/UpdateDownloadProgress.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDownloadProgress.json.cs new file mode 100644 index 000000000000..6b9dd501a0ba --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateDownloadProgress.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Details about the download progress of update. + 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgress. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgress. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDownloadProgress FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._downloadPhase)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._downloadPhase.ToString()) : null, "downloadPhase" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._percentComplete ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._percentComplete) : null, "percentComplete" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalBytesToDownload ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((double)this._totalBytesToDownload) : null, "totalBytesToDownload" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalBytesDownloaded ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((double)this._totalBytesDownloaded) : null, "totalBytesDownloaded" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._numberOfUpdatesToDownload ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._numberOfUpdatesToDownload) : null, "numberOfUpdatesToDownload" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._numberOfUpdatesDownloaded ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._numberOfUpdatesDownloaded) : null, "numberOfUpdatesDownloaded" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal UpdateDownloadProgress(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/UpdateInstallProgress.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateInstallProgress.PowerShell.cs new file mode 100644 index 000000000000..edd55a1b20b7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateInstallProgress.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Progress details 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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IUpdateInstallProgress FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)this).PercentComplete = (int?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)this).PercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NumberOfUpdatesToInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)this).NumberOfUpdatesToInstall = (int?) content.GetValueForProperty("NumberOfUpdatesToInstall",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)this).NumberOfUpdatesToInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NumberOfUpdatesInstalled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)this).NumberOfUpdatesInstalled = (int?) content.GetValueForProperty("NumberOfUpdatesInstalled",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)this).PercentComplete = (int?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)this).PercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NumberOfUpdatesToInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)this).NumberOfUpdatesToInstall = (int?) content.GetValueForProperty("NumberOfUpdatesToInstall",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)this).NumberOfUpdatesToInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NumberOfUpdatesInstalled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)this).NumberOfUpdatesInstalled = (int?) content.GetValueForProperty("NumberOfUpdatesInstalled",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal)this).NumberOfUpdatesInstalled, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + } + /// Progress details during installation of updates. + [System.ComponentModel.TypeConverter(typeof(UpdateInstallProgressTypeConverter))] + public partial interface IUpdateInstallProgress + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateInstallProgress.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateInstallProgress.TypeConverter.cs new file mode 100644 index 000000000000..6e7a32d3bd29 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IUpdateInstallProgress ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/UpdateInstallProgress.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateInstallProgress.cs new file mode 100644 index 000000000000..85d4b33434c4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateInstallProgress.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Progress details during installation of updates. + public partial class UpdateInstallProgress : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgress, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal + { + + /// Internal Acessors for NumberOfUpdatesInstalled + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal.NumberOfUpdatesInstalled { get => this._numberOfUpdatesInstalled; set { {_numberOfUpdatesInstalled = value;} } } + + /// Internal Acessors for NumberOfUpdatesToInstall + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal.NumberOfUpdatesToInstall { get => this._numberOfUpdatesToInstall; set { {_numberOfUpdatesToInstall = value;} } } + + /// Internal Acessors for PercentComplete + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgressInternal.PercentComplete { get => this._percentComplete; set { {_percentComplete = value;} } } + + /// Backing field for property. + private int? _numberOfUpdatesInstalled; + + /// Number of updates installed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? NumberOfUpdatesInstalled { get => this._numberOfUpdatesInstalled; } + + /// Backing field for property. + private int? _numberOfUpdatesToInstall; + + /// Number of updates to install. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? NumberOfUpdatesToInstall { get => this._numberOfUpdatesToInstall; } + + /// Backing field for property. + private int? _percentComplete; + + /// Percentage completed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? PercentComplete { get => this._percentComplete; } + + /// Creates an new instance. + public UpdateInstallProgress() + { + + } + } + /// Progress details during installation of updates. + public partial interface IUpdateInstallProgress : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Number of updates installed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of updates installed.", + SerializedName = @"numberOfUpdatesInstalled", + PossibleTypes = new [] { typeof(int) })] + int? NumberOfUpdatesInstalled { get; } + /// Number of updates to install. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Number of updates to install.", + SerializedName = @"numberOfUpdatesToInstall", + PossibleTypes = new [] { typeof(int) })] + int? NumberOfUpdatesToInstall { get; } + /// Percentage completed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Percentage completed.", + SerializedName = @"percentComplete", + PossibleTypes = new [] { typeof(int) })] + int? PercentComplete { get; } + + } + /// Progress details 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 completed. + int? PercentComplete { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateInstallProgress.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateInstallProgress.json.cs new file mode 100644 index 000000000000..01b221122993 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateInstallProgress.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Progress details 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgress. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgress. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateInstallProgress FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._percentComplete ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._percentComplete) : null, "percentComplete" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._numberOfUpdatesToInstall ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._numberOfUpdatesToInstall) : null, "numberOfUpdatesToInstall" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._numberOfUpdatesInstalled ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._numberOfUpdatesInstalled) : null, "numberOfUpdatesInstalled" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal UpdateInstallProgress(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Models/Api20220301/UpdateSummary.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummary.PowerShell.cs new file mode 100644 index 000000000000..0049b442920a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummary.PowerShell.cs @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Details about ongoing updates and availability of updates on the device. + [System.ComponentModel.TypeConverter(typeof(UpdateSummaryTypeConverter))] + public partial class UpdateSummary + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IUpdateSummary DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UpdateSummary(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.DataBoxEdge.Models.Api20220301.IUpdateSummary DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UpdateSummary(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.DataBoxEdge.Models.Api20220301.IUpdateSummary FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UpdateSummary(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.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateSummaryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DeviceVersionNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).DeviceVersionNumber = (string) content.GetValueForProperty("DeviceVersionNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).DeviceVersionNumber, global::System.Convert.ToString); + } + if (content.Contains("FriendlyDeviceVersionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).FriendlyDeviceVersionName = (string) content.GetValueForProperty("FriendlyDeviceVersionName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).FriendlyDeviceVersionName, global::System.Convert.ToString); + } + if (content.Contains("DeviceLastScannedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).DeviceLastScannedDateTime = (global::System.DateTime?) content.GetValueForProperty("DeviceLastScannedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).DeviceLastScannedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedScanJobDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedScanJobDateTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedScanJobDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedScanJobDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastSuccessfulScanJobTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastSuccessfulScanJobTime = (global::System.DateTime?) content.GetValueForProperty("LastSuccessfulScanJobTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastSuccessfulScanJobTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedDownloadJobDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedDownloadJobDateTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedDownloadJobDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedDownloadJobDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedDownloadJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedDownloadJobId = (string) content.GetValueForProperty("LastCompletedDownloadJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedDownloadJobId, global::System.Convert.ToString); + } + if (content.Contains("LastDownloadJobStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastDownloadJobStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus?) content.GetValueForProperty("LastDownloadJobStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastDownloadJobStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus.CreateFrom); + } + if (content.Contains("LastSuccessfulInstallJobDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastSuccessfulInstallJobDateTime = (global::System.DateTime?) content.GetValueForProperty("LastSuccessfulInstallJobDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastSuccessfulInstallJobDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedInstallJobDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedInstallJobDateTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedInstallJobDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedInstallJobDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedInstallJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedInstallJobId = (string) content.GetValueForProperty("LastCompletedInstallJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedInstallJobId, global::System.Convert.ToString); + } + if (content.Contains("LastInstallJobStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastInstallJobStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus?) content.GetValueForProperty("LastInstallJobStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastInstallJobStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus.CreateFrom); + } + if (content.Contains("TotalNumberOfUpdatesAvailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalNumberOfUpdatesAvailable = (int?) content.GetValueForProperty("TotalNumberOfUpdatesAvailable",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalNumberOfUpdatesAvailable, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalNumberOfUpdatesPendingDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalNumberOfUpdatesPendingDownload = (int?) content.GetValueForProperty("TotalNumberOfUpdatesPendingDownload",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalNumberOfUpdatesPendingDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalNumberOfUpdatesPendingInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalNumberOfUpdatesPendingInstall = (int?) content.GetValueForProperty("TotalNumberOfUpdatesPendingInstall",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalNumberOfUpdatesPendingInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RebootBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).RebootBehavior = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior?) content.GetValueForProperty("RebootBehavior",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).RebootBehavior, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior.CreateFrom); + } + if (content.Contains("OngoingUpdateOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).OngoingUpdateOperation = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation?) content.GetValueForProperty("OngoingUpdateOperation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).OngoingUpdateOperation, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation.CreateFrom); + } + if (content.Contains("InProgressDownloadJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).InProgressDownloadJobId = (string) content.GetValueForProperty("InProgressDownloadJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).InProgressDownloadJobId, global::System.Convert.ToString); + } + if (content.Contains("InProgressInstallJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).InProgressInstallJobId = (string) content.GetValueForProperty("InProgressInstallJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).InProgressInstallJobId, global::System.Convert.ToString); + } + if (content.Contains("InProgressDownloadJobStartedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).InProgressDownloadJobStartedDateTime = (global::System.DateTime?) content.GetValueForProperty("InProgressDownloadJobStartedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).InProgressDownloadJobStartedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InProgressInstallJobStartedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).InProgressInstallJobStartedDateTime = (global::System.DateTime?) content.GetValueForProperty("InProgressInstallJobStartedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).InProgressInstallJobStartedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdateTitle")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).UpdateTitle = (string[]) content.GetValueForProperty("UpdateTitle",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).UpdateTitle, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Update")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).Update = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails[]) content.GetValueForProperty("Update",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).Update, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("TotalUpdateSizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalUpdateSizeInByte = (double?) content.GetValueForProperty("TotalUpdateSizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalUpdateSizeInByte, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("TotalTimeInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalTimeInMinute = (int?) content.GetValueForProperty("TotalTimeInMinute",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalTimeInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataLastModifiedAt, (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 UpdateSummary(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.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateSummaryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DeviceVersionNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).DeviceVersionNumber = (string) content.GetValueForProperty("DeviceVersionNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).DeviceVersionNumber, global::System.Convert.ToString); + } + if (content.Contains("FriendlyDeviceVersionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).FriendlyDeviceVersionName = (string) content.GetValueForProperty("FriendlyDeviceVersionName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).FriendlyDeviceVersionName, global::System.Convert.ToString); + } + if (content.Contains("DeviceLastScannedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).DeviceLastScannedDateTime = (global::System.DateTime?) content.GetValueForProperty("DeviceLastScannedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).DeviceLastScannedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedScanJobDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedScanJobDateTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedScanJobDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedScanJobDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastSuccessfulScanJobTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastSuccessfulScanJobTime = (global::System.DateTime?) content.GetValueForProperty("LastSuccessfulScanJobTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastSuccessfulScanJobTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedDownloadJobDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedDownloadJobDateTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedDownloadJobDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedDownloadJobDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedDownloadJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedDownloadJobId = (string) content.GetValueForProperty("LastCompletedDownloadJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedDownloadJobId, global::System.Convert.ToString); + } + if (content.Contains("LastDownloadJobStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastDownloadJobStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus?) content.GetValueForProperty("LastDownloadJobStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastDownloadJobStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus.CreateFrom); + } + if (content.Contains("LastSuccessfulInstallJobDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastSuccessfulInstallJobDateTime = (global::System.DateTime?) content.GetValueForProperty("LastSuccessfulInstallJobDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastSuccessfulInstallJobDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedInstallJobDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedInstallJobDateTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedInstallJobDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedInstallJobDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedInstallJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedInstallJobId = (string) content.GetValueForProperty("LastCompletedInstallJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastCompletedInstallJobId, global::System.Convert.ToString); + } + if (content.Contains("LastInstallJobStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastInstallJobStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus?) content.GetValueForProperty("LastInstallJobStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).LastInstallJobStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus.CreateFrom); + } + if (content.Contains("TotalNumberOfUpdatesAvailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalNumberOfUpdatesAvailable = (int?) content.GetValueForProperty("TotalNumberOfUpdatesAvailable",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalNumberOfUpdatesAvailable, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalNumberOfUpdatesPendingDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalNumberOfUpdatesPendingDownload = (int?) content.GetValueForProperty("TotalNumberOfUpdatesPendingDownload",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalNumberOfUpdatesPendingDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalNumberOfUpdatesPendingInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalNumberOfUpdatesPendingInstall = (int?) content.GetValueForProperty("TotalNumberOfUpdatesPendingInstall",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalNumberOfUpdatesPendingInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RebootBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).RebootBehavior = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior?) content.GetValueForProperty("RebootBehavior",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).RebootBehavior, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior.CreateFrom); + } + if (content.Contains("OngoingUpdateOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).OngoingUpdateOperation = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation?) content.GetValueForProperty("OngoingUpdateOperation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).OngoingUpdateOperation, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation.CreateFrom); + } + if (content.Contains("InProgressDownloadJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).InProgressDownloadJobId = (string) content.GetValueForProperty("InProgressDownloadJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).InProgressDownloadJobId, global::System.Convert.ToString); + } + if (content.Contains("InProgressInstallJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).InProgressInstallJobId = (string) content.GetValueForProperty("InProgressInstallJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).InProgressInstallJobId, global::System.Convert.ToString); + } + if (content.Contains("InProgressDownloadJobStartedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).InProgressDownloadJobStartedDateTime = (global::System.DateTime?) content.GetValueForProperty("InProgressDownloadJobStartedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).InProgressDownloadJobStartedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InProgressInstallJobStartedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).InProgressInstallJobStartedDateTime = (global::System.DateTime?) content.GetValueForProperty("InProgressInstallJobStartedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).InProgressInstallJobStartedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdateTitle")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).UpdateTitle = (string[]) content.GetValueForProperty("UpdateTitle",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).UpdateTitle, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Update")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).Update = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails[]) content.GetValueForProperty("Update",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).Update, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("TotalUpdateSizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalUpdateSizeInByte = (double?) content.GetValueForProperty("TotalUpdateSizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalUpdateSizeInByte, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("TotalTimeInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalTimeInMinute = (int?) content.GetValueForProperty("TotalTimeInMinute",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).TotalTimeInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + } + /// Details about ongoing updates and availability of updates on the device. + [System.ComponentModel.TypeConverter(typeof(UpdateSummaryTypeConverter))] + public partial interface IUpdateSummary + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummary.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummary.TypeConverter.cs new file mode 100644 index 000000000000..7ed59d36d88d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummary.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UpdateSummaryTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IUpdateSummary ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummary).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UpdateSummary.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UpdateSummary.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UpdateSummary.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/databoxedge/generated/api/Models/Api20220301/UpdateSummary.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummary.cs new file mode 100644 index 000000000000..364acea2ad01 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummary.cs @@ -0,0 +1,619 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Details about ongoing updates and availability of updates on the device. + public partial class UpdateSummary : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummary, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// The last time when a scan was done on the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? DeviceLastScannedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).DeviceLastScannedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).DeviceLastScannedDateTime = value ?? default(global::System.DateTime); } + + /// The current version of the device in format: 1.2.17312.13.", + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string DeviceVersionNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).DeviceVersionNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).DeviceVersionNumber = value ?? null; } + + /// The current version of the device in text format. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string FriendlyDeviceVersionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).FriendlyDeviceVersionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).FriendlyDeviceVersionName = value ?? null; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// The job ID of the download job in progress. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string InProgressDownloadJobId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).InProgressDownloadJobId; } + + /// The time when the currently running download (if any) started. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? InProgressDownloadJobStartedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).InProgressDownloadJobStartedDateTime; } + + /// The job ID of the install job in progress. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string InProgressInstallJobId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).InProgressInstallJobId; } + + /// The time when the currently running install (if any) started. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? InProgressInstallJobStartedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).InProgressInstallJobStartedDateTime; } + + /// + /// The time when the last Download job was completed (success/cancelled/failed) on the appliance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? LastCompletedDownloadJobDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastCompletedDownloadJobDateTime; } + + /// JobId of the last ran download job.(Can be success/cancelled/failed) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string LastCompletedDownloadJobId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastCompletedDownloadJobId; } + + /// + /// The time when the last Install job was completed (success/cancelled/failed) on the appliance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? LastCompletedInstallJobDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastCompletedInstallJobDateTime; } + + /// JobId of the last ran install job.(Can be success/cancelled/failed) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string LastCompletedInstallJobId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastCompletedInstallJobId; } + + /// + /// The time when the last scan job was completed (success/cancelled/failed) on the appliance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? LastCompletedScanJobDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastCompletedScanJobDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastCompletedScanJobDateTime = value ?? default(global::System.DateTime); } + + /// JobStatus of the last ran download job. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? LastDownloadJobStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastDownloadJobStatus; } + + /// JobStatus of the last ran install job. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? LastInstallJobStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastInstallJobStatus; } + + /// The time when the Last Install job was completed successfully on the appliance + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? LastSuccessfulInstallJobDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastSuccessfulInstallJobDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastSuccessfulInstallJobDateTime = value ?? default(global::System.DateTime); } + + /// Time when the last scan job is successfully completed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? LastSuccessfulScanJobTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastSuccessfulScanJobTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastSuccessfulScanJobTime = value ?? default(global::System.DateTime); } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for InProgressDownloadJobId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.InProgressDownloadJobId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).InProgressDownloadJobId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).InProgressDownloadJobId = value; } + + /// Internal Acessors for InProgressDownloadJobStartedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.InProgressDownloadJobStartedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).InProgressDownloadJobStartedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).InProgressDownloadJobStartedDateTime = value; } + + /// Internal Acessors for InProgressInstallJobId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.InProgressInstallJobId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).InProgressInstallJobId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).InProgressInstallJobId = value; } + + /// Internal Acessors for InProgressInstallJobStartedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.InProgressInstallJobStartedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).InProgressInstallJobStartedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).InProgressInstallJobStartedDateTime = value; } + + /// Internal Acessors for LastCompletedDownloadJobDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.LastCompletedDownloadJobDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastCompletedDownloadJobDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastCompletedDownloadJobDateTime = value; } + + /// Internal Acessors for LastCompletedDownloadJobId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.LastCompletedDownloadJobId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastCompletedDownloadJobId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastCompletedDownloadJobId = value; } + + /// Internal Acessors for LastCompletedInstallJobDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.LastCompletedInstallJobDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastCompletedInstallJobDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastCompletedInstallJobDateTime = value; } + + /// Internal Acessors for LastCompletedInstallJobId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.LastCompletedInstallJobId { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastCompletedInstallJobId; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastCompletedInstallJobId = value; } + + /// Internal Acessors for LastDownloadJobStatus + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.LastDownloadJobStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastDownloadJobStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastDownloadJobStatus = value; } + + /// Internal Acessors for LastInstallJobStatus + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.LastInstallJobStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastInstallJobStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).LastInstallJobStatus = value; } + + /// Internal Acessors for OngoingUpdateOperation + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.OngoingUpdateOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).OngoingUpdateOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).OngoingUpdateOperation = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateSummaryProperties()); set { {_property = value;} } } + + /// Internal Acessors for RebootBehavior + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.RebootBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).RebootBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).RebootBehavior = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for TotalNumberOfUpdatesAvailable + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.TotalNumberOfUpdatesAvailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).TotalNumberOfUpdatesAvailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).TotalNumberOfUpdatesAvailable = value; } + + /// Internal Acessors for TotalNumberOfUpdatesPendingDownload + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.TotalNumberOfUpdatesPendingDownload { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).TotalNumberOfUpdatesPendingDownload; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).TotalNumberOfUpdatesPendingDownload = value; } + + /// Internal Acessors for TotalNumberOfUpdatesPendingInstall + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.TotalNumberOfUpdatesPendingInstall { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).TotalNumberOfUpdatesPendingInstall; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).TotalNumberOfUpdatesPendingInstall = value; } + + /// Internal Acessors for TotalTimeInMinute + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.TotalTimeInMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).TotalTimeInMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).TotalTimeInMinute = value; } + + /// Internal Acessors for TotalUpdateSizeInByte + double? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.TotalUpdateSizeInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).TotalUpdateSizeInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).TotalUpdateSizeInByte = value; } + + /// Internal Acessors for Update + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.Update { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).Update; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).Update = value; } + + /// Internal Acessors for UpdateTitle + string[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryInternal.UpdateTitle { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).UpdateTitle; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).UpdateTitle = value; } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// The current update operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation? OngoingUpdateOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).OngoingUpdateOperation; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryProperties _property; + + /// The device update information summary. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateSummaryProperties()); set => this._property = value; } + + /// + /// Indicates if updates are available and at least one of the updates needs a reboot. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior? RebootBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).RebootBehavior; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of UpdateSummary + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// + /// The number of updates available for the current device version as per the last device scan. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? TotalNumberOfUpdatesAvailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).TotalNumberOfUpdatesAvailable; } + + /// The total number of items pending download. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? TotalNumberOfUpdatesPendingDownload { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).TotalNumberOfUpdatesPendingDownload; } + + /// The total number of items pending install. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? TotalNumberOfUpdatesPendingInstall { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).TotalNumberOfUpdatesPendingInstall; } + + /// The total time in Minutes + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public int? TotalTimeInMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).TotalTimeInMinute; } + + /// The total size of updates available for download in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public double? TotalUpdateSizeInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).TotalUpdateSizeInByte; } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// The list of updates available for install. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails[] Update { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).Update; } + + /// The list of updates available for install. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string[] UpdateTitle { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)Property).UpdateTitle; } + + /// Creates an new instance. + public UpdateSummary() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// Details about ongoing updates and availability of updates on the device. + public partial interface IUpdateSummary : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// The last time when a scan was done on the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The last time when a scan was done on the device.", + SerializedName = @"deviceLastScannedDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? DeviceLastScannedDateTime { get; set; } + /// The current version of the device in format: 1.2.17312.13.", + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The current version of the device in format: 1.2.17312.13."",", + SerializedName = @"deviceVersionNumber", + PossibleTypes = new [] { typeof(string) })] + string DeviceVersionNumber { get; set; } + /// The current version of the device in text format. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The current version of the device in text format.", + SerializedName = @"friendlyDeviceVersionName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyDeviceVersionName { get; set; } + /// The job ID of the download job in progress. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The job ID of the download job in progress.", + SerializedName = @"inProgressDownloadJobId", + PossibleTypes = new [] { typeof(string) })] + string InProgressDownloadJobId { get; } + /// The time when the currently running download (if any) started. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The time when the currently running download (if any) started.", + SerializedName = @"inProgressDownloadJobStartedDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? InProgressDownloadJobStartedDateTime { get; } + /// The job ID of the install job in progress. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The job ID of the install job in progress.", + SerializedName = @"inProgressInstallJobId", + PossibleTypes = new [] { typeof(string) })] + string InProgressInstallJobId { get; } + /// The time when the currently running install (if any) started. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The time when the currently running install (if any) started.", + SerializedName = @"inProgressInstallJobStartedDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? InProgressInstallJobStartedDateTime { get; } + /// + /// The time when the last Download job was completed (success/cancelled/failed) on the appliance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The time when the last Download job was completed (success/cancelled/failed) on the appliance.", + SerializedName = @"lastCompletedDownloadJobDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastCompletedDownloadJobDateTime { get; } + /// JobId of the last ran download job.(Can be success/cancelled/failed) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"JobId of the last ran download job.(Can be success/cancelled/failed)", + SerializedName = @"lastCompletedDownloadJobId", + PossibleTypes = new [] { typeof(string) })] + string LastCompletedDownloadJobId { get; } + /// + /// The time when the last Install job was completed (success/cancelled/failed) on the appliance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The time when the last Install job was completed (success/cancelled/failed) on the appliance.", + SerializedName = @"lastCompletedInstallJobDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastCompletedInstallJobDateTime { get; } + /// JobId of the last ran install job.(Can be success/cancelled/failed) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"JobId of the last ran install job.(Can be success/cancelled/failed)", + SerializedName = @"lastCompletedInstallJobId", + PossibleTypes = new [] { typeof(string) })] + string LastCompletedInstallJobId { get; } + /// + /// The time when the last scan job was completed (success/cancelled/failed) on the appliance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the last scan job was completed (success/cancelled/failed) on the appliance.", + SerializedName = @"lastCompletedScanJobDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastCompletedScanJobDateTime { get; set; } + /// JobStatus of the last ran download job. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"JobStatus of the last ran download job.", + SerializedName = @"lastDownloadJobStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? LastDownloadJobStatus { get; } + /// JobStatus of the last ran install job. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"JobStatus of the last ran install job.", + SerializedName = @"lastInstallJobStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? LastInstallJobStatus { get; } + /// The time when the Last Install job was completed successfully on the appliance + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the Last Install job was completed successfully on the appliance", + SerializedName = @"lastSuccessfulInstallJobDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastSuccessfulInstallJobDateTime { get; set; } + /// Time when the last scan job is successfully completed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time when the last scan job is successfully completed.", + SerializedName = @"lastSuccessfulScanJobTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastSuccessfulScanJobTime { get; set; } + /// The current update operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current update operation.", + SerializedName = @"ongoingUpdateOperation", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation? OngoingUpdateOperation { get; } + /// + /// Indicates if updates are available and at least one of the updates needs a reboot. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates if updates are available and at least one of the updates needs a reboot.", + SerializedName = @"rebootBehavior", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior? RebootBehavior { get; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// + /// The number of updates available for the current device version as per the last device scan. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The number of updates available for the current device version as per the last device scan.", + SerializedName = @"totalNumberOfUpdatesAvailable", + PossibleTypes = new [] { typeof(int) })] + int? TotalNumberOfUpdatesAvailable { get; } + /// The total number of items pending download. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The total number of items pending download.", + SerializedName = @"totalNumberOfUpdatesPendingDownload", + PossibleTypes = new [] { typeof(int) })] + int? TotalNumberOfUpdatesPendingDownload { get; } + /// The total number of items pending install. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The total number of items pending install.", + SerializedName = @"totalNumberOfUpdatesPendingInstall", + PossibleTypes = new [] { typeof(int) })] + int? TotalNumberOfUpdatesPendingInstall { get; } + /// The total time in Minutes + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The total time in Minutes", + SerializedName = @"totalTimeInMinutes", + PossibleTypes = new [] { typeof(int) })] + int? TotalTimeInMinute { get; } + /// The total size of updates available for download in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The total size of updates available for download in bytes.", + SerializedName = @"totalUpdateSizeInBytes", + PossibleTypes = new [] { typeof(double) })] + double? TotalUpdateSizeInByte { get; } + /// The list of updates available for install. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of updates available for install.", + SerializedName = @"updates", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails[] Update { get; } + /// The list of updates available for install. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of updates available for install.", + SerializedName = @"updateTitles", + PossibleTypes = new [] { typeof(string) })] + string[] UpdateTitle { get; } + + } + /// Details about ongoing updates and availability of updates on the device. + internal partial interface IUpdateSummaryInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// The last time when a scan was done on the device. + global::System.DateTime? DeviceLastScannedDateTime { get; set; } + /// The current version of the device in format: 1.2.17312.13.", + string DeviceVersionNumber { get; set; } + /// The current version of the device in text format. + string FriendlyDeviceVersionName { get; set; } + /// The job ID of the download job in progress. + string InProgressDownloadJobId { get; set; } + /// The time when the currently running download (if any) started. + global::System.DateTime? InProgressDownloadJobStartedDateTime { get; set; } + /// The job ID of the install job in progress. + string InProgressInstallJobId { get; set; } + /// The time when the currently running install (if any) started. + global::System.DateTime? InProgressInstallJobStartedDateTime { get; set; } + /// + /// The time when the last Download job was completed (success/cancelled/failed) on the appliance. + /// + global::System.DateTime? LastCompletedDownloadJobDateTime { get; set; } + /// JobId of the last ran download job.(Can be success/cancelled/failed) + string LastCompletedDownloadJobId { get; set; } + /// + /// The time when the last Install job was completed (success/cancelled/failed) on the appliance. + /// + global::System.DateTime? LastCompletedInstallJobDateTime { get; set; } + /// JobId of the last ran install job.(Can be success/cancelled/failed) + string LastCompletedInstallJobId { get; set; } + /// + /// The time when the last scan job was completed (success/cancelled/failed) on the appliance. + /// + global::System.DateTime? LastCompletedScanJobDateTime { get; set; } + /// JobStatus of the last ran download job. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? LastDownloadJobStatus { get; set; } + /// JobStatus of the last ran install job. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? LastInstallJobStatus { get; set; } + /// The time when the Last Install job was completed successfully on the appliance + global::System.DateTime? LastSuccessfulInstallJobDateTime { get; set; } + /// Time when the last scan job is successfully completed. + global::System.DateTime? LastSuccessfulScanJobTime { get; set; } + /// The current update operation. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation? OngoingUpdateOperation { get; set; } + /// The device update information summary. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryProperties Property { get; set; } + /// + /// Indicates if updates are available and at least one of the updates needs a reboot. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior? RebootBehavior { get; set; } + /// Metadata pertaining to creation and last modification of UpdateSummary + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// + /// The number of updates available for the current device version as per the last device scan. + /// + int? TotalNumberOfUpdatesAvailable { get; set; } + /// The total number of items pending download. + int? TotalNumberOfUpdatesPendingDownload { get; set; } + /// The total number of items pending install. + int? TotalNumberOfUpdatesPendingInstall { get; set; } + /// The total time in Minutes + int? TotalTimeInMinute { get; set; } + /// The total size of updates available for download in bytes. + double? TotalUpdateSizeInByte { get; set; } + /// The list of updates available for install. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails[] Update { get; set; } + /// The list of updates available for install. + string[] UpdateTitle { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummary.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummary.json.cs new file mode 100644 index 000000000000..2d4c1c58e500 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummary.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Details about ongoing updates and availability of updates on the device. + public partial class UpdateSummary + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummary. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummary. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummary FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new UpdateSummary(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal UpdateSummary(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateSummaryProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummaryProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummaryProperties.PowerShell.cs new file mode 100644 index 000000000000..8c0d1d78cd80 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummaryProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The device update information summary. + [System.ComponentModel.TypeConverter(typeof(UpdateSummaryPropertiesTypeConverter))] + public partial class UpdateSummaryProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IUpdateSummaryProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UpdateSummaryProperties(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.DataBoxEdge.Models.Api20220301.IUpdateSummaryProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UpdateSummaryProperties(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.DataBoxEdge.Models.Api20220301.IUpdateSummaryProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UpdateSummaryProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DeviceVersionNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).DeviceVersionNumber = (string) content.GetValueForProperty("DeviceVersionNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).DeviceVersionNumber, global::System.Convert.ToString); + } + if (content.Contains("FriendlyDeviceVersionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).FriendlyDeviceVersionName = (string) content.GetValueForProperty("FriendlyDeviceVersionName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).FriendlyDeviceVersionName, global::System.Convert.ToString); + } + if (content.Contains("DeviceLastScannedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).DeviceLastScannedDateTime = (global::System.DateTime?) content.GetValueForProperty("DeviceLastScannedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).DeviceLastScannedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedScanJobDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedScanJobDateTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedScanJobDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedScanJobDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastSuccessfulScanJobTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastSuccessfulScanJobTime = (global::System.DateTime?) content.GetValueForProperty("LastSuccessfulScanJobTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastSuccessfulScanJobTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedDownloadJobDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedDownloadJobDateTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedDownloadJobDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedDownloadJobDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedDownloadJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedDownloadJobId = (string) content.GetValueForProperty("LastCompletedDownloadJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedDownloadJobId, global::System.Convert.ToString); + } + if (content.Contains("LastDownloadJobStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastDownloadJobStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus?) content.GetValueForProperty("LastDownloadJobStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastDownloadJobStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus.CreateFrom); + } + if (content.Contains("LastSuccessfulInstallJobDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastSuccessfulInstallJobDateTime = (global::System.DateTime?) content.GetValueForProperty("LastSuccessfulInstallJobDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastSuccessfulInstallJobDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedInstallJobDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedInstallJobDateTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedInstallJobDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedInstallJobDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedInstallJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedInstallJobId = (string) content.GetValueForProperty("LastCompletedInstallJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedInstallJobId, global::System.Convert.ToString); + } + if (content.Contains("LastInstallJobStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastInstallJobStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus?) content.GetValueForProperty("LastInstallJobStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastInstallJobStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus.CreateFrom); + } + if (content.Contains("TotalNumberOfUpdatesAvailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalNumberOfUpdatesAvailable = (int?) content.GetValueForProperty("TotalNumberOfUpdatesAvailable",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalNumberOfUpdatesAvailable, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalNumberOfUpdatesPendingDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalNumberOfUpdatesPendingDownload = (int?) content.GetValueForProperty("TotalNumberOfUpdatesPendingDownload",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalNumberOfUpdatesPendingDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalNumberOfUpdatesPendingInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalNumberOfUpdatesPendingInstall = (int?) content.GetValueForProperty("TotalNumberOfUpdatesPendingInstall",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalNumberOfUpdatesPendingInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RebootBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).RebootBehavior = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior?) content.GetValueForProperty("RebootBehavior",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).RebootBehavior, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior.CreateFrom); + } + if (content.Contains("OngoingUpdateOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).OngoingUpdateOperation = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation?) content.GetValueForProperty("OngoingUpdateOperation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).OngoingUpdateOperation, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation.CreateFrom); + } + if (content.Contains("InProgressDownloadJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).InProgressDownloadJobId = (string) content.GetValueForProperty("InProgressDownloadJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).InProgressDownloadJobId, global::System.Convert.ToString); + } + if (content.Contains("InProgressInstallJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).InProgressInstallJobId = (string) content.GetValueForProperty("InProgressInstallJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).InProgressInstallJobId, global::System.Convert.ToString); + } + if (content.Contains("InProgressDownloadJobStartedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).InProgressDownloadJobStartedDateTime = (global::System.DateTime?) content.GetValueForProperty("InProgressDownloadJobStartedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).InProgressDownloadJobStartedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InProgressInstallJobStartedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).InProgressInstallJobStartedDateTime = (global::System.DateTime?) content.GetValueForProperty("InProgressInstallJobStartedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).InProgressInstallJobStartedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdateTitle")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).UpdateTitle = (string[]) content.GetValueForProperty("UpdateTitle",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).UpdateTitle, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Update")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).Update = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails[]) content.GetValueForProperty("Update",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).Update, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("TotalUpdateSizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalUpdateSizeInByte = (double?) content.GetValueForProperty("TotalUpdateSizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalUpdateSizeInByte, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("TotalTimeInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalTimeInMinute = (int?) content.GetValueForProperty("TotalTimeInMinute",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalTimeInMinute, (__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 UpdateSummaryProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DeviceVersionNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).DeviceVersionNumber = (string) content.GetValueForProperty("DeviceVersionNumber",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).DeviceVersionNumber, global::System.Convert.ToString); + } + if (content.Contains("FriendlyDeviceVersionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).FriendlyDeviceVersionName = (string) content.GetValueForProperty("FriendlyDeviceVersionName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).FriendlyDeviceVersionName, global::System.Convert.ToString); + } + if (content.Contains("DeviceLastScannedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).DeviceLastScannedDateTime = (global::System.DateTime?) content.GetValueForProperty("DeviceLastScannedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).DeviceLastScannedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedScanJobDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedScanJobDateTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedScanJobDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedScanJobDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastSuccessfulScanJobTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastSuccessfulScanJobTime = (global::System.DateTime?) content.GetValueForProperty("LastSuccessfulScanJobTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastSuccessfulScanJobTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedDownloadJobDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedDownloadJobDateTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedDownloadJobDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedDownloadJobDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedDownloadJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedDownloadJobId = (string) content.GetValueForProperty("LastCompletedDownloadJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedDownloadJobId, global::System.Convert.ToString); + } + if (content.Contains("LastDownloadJobStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastDownloadJobStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus?) content.GetValueForProperty("LastDownloadJobStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastDownloadJobStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus.CreateFrom); + } + if (content.Contains("LastSuccessfulInstallJobDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastSuccessfulInstallJobDateTime = (global::System.DateTime?) content.GetValueForProperty("LastSuccessfulInstallJobDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastSuccessfulInstallJobDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedInstallJobDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedInstallJobDateTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedInstallJobDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedInstallJobDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedInstallJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedInstallJobId = (string) content.GetValueForProperty("LastCompletedInstallJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastCompletedInstallJobId, global::System.Convert.ToString); + } + if (content.Contains("LastInstallJobStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastInstallJobStatus = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus?) content.GetValueForProperty("LastInstallJobStatus",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).LastInstallJobStatus, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus.CreateFrom); + } + if (content.Contains("TotalNumberOfUpdatesAvailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalNumberOfUpdatesAvailable = (int?) content.GetValueForProperty("TotalNumberOfUpdatesAvailable",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalNumberOfUpdatesAvailable, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalNumberOfUpdatesPendingDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalNumberOfUpdatesPendingDownload = (int?) content.GetValueForProperty("TotalNumberOfUpdatesPendingDownload",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalNumberOfUpdatesPendingDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalNumberOfUpdatesPendingInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalNumberOfUpdatesPendingInstall = (int?) content.GetValueForProperty("TotalNumberOfUpdatesPendingInstall",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalNumberOfUpdatesPendingInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RebootBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).RebootBehavior = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior?) content.GetValueForProperty("RebootBehavior",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).RebootBehavior, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior.CreateFrom); + } + if (content.Contains("OngoingUpdateOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).OngoingUpdateOperation = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation?) content.GetValueForProperty("OngoingUpdateOperation",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).OngoingUpdateOperation, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation.CreateFrom); + } + if (content.Contains("InProgressDownloadJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).InProgressDownloadJobId = (string) content.GetValueForProperty("InProgressDownloadJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).InProgressDownloadJobId, global::System.Convert.ToString); + } + if (content.Contains("InProgressInstallJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).InProgressInstallJobId = (string) content.GetValueForProperty("InProgressInstallJobId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).InProgressInstallJobId, global::System.Convert.ToString); + } + if (content.Contains("InProgressDownloadJobStartedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).InProgressDownloadJobStartedDateTime = (global::System.DateTime?) content.GetValueForProperty("InProgressDownloadJobStartedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).InProgressDownloadJobStartedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InProgressInstallJobStartedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).InProgressInstallJobStartedDateTime = (global::System.DateTime?) content.GetValueForProperty("InProgressInstallJobStartedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).InProgressInstallJobStartedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdateTitle")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).UpdateTitle = (string[]) content.GetValueForProperty("UpdateTitle",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).UpdateTitle, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Update")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).Update = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails[]) content.GetValueForProperty("Update",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).Update, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateDetailsTypeConverter.ConvertFrom)); + } + if (content.Contains("TotalUpdateSizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalUpdateSizeInByte = (double?) content.GetValueForProperty("TotalUpdateSizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalUpdateSizeInByte, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("TotalTimeInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalTimeInMinute = (int?) content.GetValueForProperty("TotalTimeInMinute",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal)this).TotalTimeInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + } + /// The device update information summary. + [System.ComponentModel.TypeConverter(typeof(UpdateSummaryPropertiesTypeConverter))] + public partial interface IUpdateSummaryProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummaryProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummaryProperties.TypeConverter.cs new file mode 100644 index 000000000000..cb872afb77b8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummaryProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UpdateSummaryPropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IUpdateSummaryProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UpdateSummaryProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UpdateSummaryProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UpdateSummaryProperties.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/databoxedge/generated/api/Models/Api20220301/UpdateSummaryProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummaryProperties.cs new file mode 100644 index 000000000000..4a4b600c357b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummaryProperties.cs @@ -0,0 +1,546 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The device update information summary. + public partial class UpdateSummaryProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal + { + + /// Backing field for property. + private global::System.DateTime? _deviceLastScannedDateTime; + + /// The last time when a scan was done on the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? DeviceLastScannedDateTime { get => this._deviceLastScannedDateTime; set => this._deviceLastScannedDateTime = value; } + + /// Backing field for property. + private string _deviceVersionNumber; + + /// The current version of the device in format: 1.2.17312.13.", + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string DeviceVersionNumber { get => this._deviceVersionNumber; set => this._deviceVersionNumber = value; } + + /// Backing field for property. + private string _friendlyDeviceVersionName; + + /// The current version of the device in text format. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string FriendlyDeviceVersionName { get => this._friendlyDeviceVersionName; set => this._friendlyDeviceVersionName = value; } + + /// Backing field for property. + private string _inProgressDownloadJobId; + + /// The job ID of the download job in progress. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string InProgressDownloadJobId { get => this._inProgressDownloadJobId; } + + /// Backing field for property. + private global::System.DateTime? _inProgressDownloadJobStartedDateTime; + + /// The time when the currently running download (if any) started. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? InProgressDownloadJobStartedDateTime { get => this._inProgressDownloadJobStartedDateTime; } + + /// Backing field for property. + private string _inProgressInstallJobId; + + /// The job ID of the install job in progress. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string InProgressInstallJobId { get => this._inProgressInstallJobId; } + + /// Backing field for property. + private global::System.DateTime? _inProgressInstallJobStartedDateTime; + + /// The time when the currently running install (if any) started. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? InProgressInstallJobStartedDateTime { get => this._inProgressInstallJobStartedDateTime; } + + /// Backing field for property. + private global::System.DateTime? _lastCompletedDownloadJobDateTime; + + /// + /// The time when the last Download job was completed (success/cancelled/failed) on the appliance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? LastCompletedDownloadJobDateTime { get => this._lastCompletedDownloadJobDateTime; } + + /// Backing field for property. + private string _lastCompletedDownloadJobId; + + /// JobId of the last ran download job.(Can be success/cancelled/failed) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string LastCompletedDownloadJobId { get => this._lastCompletedDownloadJobId; } + + /// Backing field for property. + private global::System.DateTime? _lastCompletedInstallJobDateTime; + + /// + /// The time when the last Install job was completed (success/cancelled/failed) on the appliance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? LastCompletedInstallJobDateTime { get => this._lastCompletedInstallJobDateTime; } + + /// Backing field for property. + private string _lastCompletedInstallJobId; + + /// JobId of the last ran install job.(Can be success/cancelled/failed) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string LastCompletedInstallJobId { get => this._lastCompletedInstallJobId; } + + /// Backing field for property. + private global::System.DateTime? _lastCompletedScanJobDateTime; + + /// + /// The time when the last scan job was completed (success/cancelled/failed) on the appliance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? LastCompletedScanJobDateTime { get => this._lastCompletedScanJobDateTime; set => this._lastCompletedScanJobDateTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? _lastDownloadJobStatus; + + /// JobStatus of the last ran download job. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? LastDownloadJobStatus { get => this._lastDownloadJobStatus; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? _lastInstallJobStatus; + + /// JobStatus of the last ran install job. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? LastInstallJobStatus { get => this._lastInstallJobStatus; } + + /// Backing field for property. + private global::System.DateTime? _lastSuccessfulInstallJobDateTime; + + /// The time when the Last Install job was completed successfully on the appliance + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? LastSuccessfulInstallJobDateTime { get => this._lastSuccessfulInstallJobDateTime; set => this._lastSuccessfulInstallJobDateTime = value; } + + /// Backing field for property. + private global::System.DateTime? _lastSuccessfulScanJobTime; + + /// Time when the last scan job is successfully completed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public global::System.DateTime? LastSuccessfulScanJobTime { get => this._lastSuccessfulScanJobTime; set => this._lastSuccessfulScanJobTime = value; } + + /// Internal Acessors for InProgressDownloadJobId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal.InProgressDownloadJobId { get => this._inProgressDownloadJobId; set { {_inProgressDownloadJobId = value;} } } + + /// Internal Acessors for InProgressDownloadJobStartedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal.InProgressDownloadJobStartedDateTime { get => this._inProgressDownloadJobStartedDateTime; set { {_inProgressDownloadJobStartedDateTime = value;} } } + + /// Internal Acessors for InProgressInstallJobId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal.InProgressInstallJobId { get => this._inProgressInstallJobId; set { {_inProgressInstallJobId = value;} } } + + /// Internal Acessors for InProgressInstallJobStartedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal.InProgressInstallJobStartedDateTime { get => this._inProgressInstallJobStartedDateTime; set { {_inProgressInstallJobStartedDateTime = value;} } } + + /// Internal Acessors for LastCompletedDownloadJobDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal.LastCompletedDownloadJobDateTime { get => this._lastCompletedDownloadJobDateTime; set { {_lastCompletedDownloadJobDateTime = value;} } } + + /// Internal Acessors for LastCompletedDownloadJobId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal.LastCompletedDownloadJobId { get => this._lastCompletedDownloadJobId; set { {_lastCompletedDownloadJobId = value;} } } + + /// Internal Acessors for LastCompletedInstallJobDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal.LastCompletedInstallJobDateTime { get => this._lastCompletedInstallJobDateTime; set { {_lastCompletedInstallJobDateTime = value;} } } + + /// Internal Acessors for LastCompletedInstallJobId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal.LastCompletedInstallJobId { get => this._lastCompletedInstallJobId; set { {_lastCompletedInstallJobId = value;} } } + + /// Internal Acessors for LastDownloadJobStatus + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal.LastDownloadJobStatus { get => this._lastDownloadJobStatus; set { {_lastDownloadJobStatus = value;} } } + + /// Internal Acessors for LastInstallJobStatus + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal.LastInstallJobStatus { get => this._lastInstallJobStatus; set { {_lastInstallJobStatus = value;} } } + + /// Internal Acessors for OngoingUpdateOperation + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal.OngoingUpdateOperation { get => this._ongoingUpdateOperation; set { {_ongoingUpdateOperation = value;} } } + + /// Internal Acessors for RebootBehavior + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal.RebootBehavior { get => this._rebootBehavior; set { {_rebootBehavior = value;} } } + + /// Internal Acessors for TotalNumberOfUpdatesAvailable + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal.TotalNumberOfUpdatesAvailable { get => this._totalNumberOfUpdatesAvailable; set { {_totalNumberOfUpdatesAvailable = value;} } } + + /// Internal Acessors for TotalNumberOfUpdatesPendingDownload + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal.TotalNumberOfUpdatesPendingDownload { get => this._totalNumberOfUpdatesPendingDownload; set { {_totalNumberOfUpdatesPendingDownload = value;} } } + + /// Internal Acessors for TotalNumberOfUpdatesPendingInstall + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal.TotalNumberOfUpdatesPendingInstall { get => this._totalNumberOfUpdatesPendingInstall; set { {_totalNumberOfUpdatesPendingInstall = value;} } } + + /// Internal Acessors for TotalTimeInMinute + int? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal.TotalTimeInMinute { get => this._totalTimeInMinute; set { {_totalTimeInMinute = value;} } } + + /// Internal Acessors for TotalUpdateSizeInByte + double? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal.TotalUpdateSizeInByte { get => this._totalUpdateSizeInByte; set { {_totalUpdateSizeInByte = value;} } } + + /// Internal Acessors for Update + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal.Update { get => this._update; set { {_update = value;} } } + + /// Internal Acessors for UpdateTitle + string[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryPropertiesInternal.UpdateTitle { get => this._updateTitle; set { {_updateTitle = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation? _ongoingUpdateOperation; + + /// The current update operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation? OngoingUpdateOperation { get => this._ongoingUpdateOperation; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior? _rebootBehavior; + + /// + /// Indicates if updates are available and at least one of the updates needs a reboot. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior? RebootBehavior { get => this._rebootBehavior; } + + /// Backing field for property. + private int? _totalNumberOfUpdatesAvailable; + + /// + /// The number of updates available for the current device version as per the last device scan. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? TotalNumberOfUpdatesAvailable { get => this._totalNumberOfUpdatesAvailable; } + + /// Backing field for property. + private int? _totalNumberOfUpdatesPendingDownload; + + /// The total number of items pending download. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? TotalNumberOfUpdatesPendingDownload { get => this._totalNumberOfUpdatesPendingDownload; } + + /// Backing field for property. + private int? _totalNumberOfUpdatesPendingInstall; + + /// The total number of items pending install. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? TotalNumberOfUpdatesPendingInstall { get => this._totalNumberOfUpdatesPendingInstall; } + + /// Backing field for property. + private int? _totalTimeInMinute; + + /// The total time in Minutes + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public int? TotalTimeInMinute { get => this._totalTimeInMinute; } + + /// Backing field for property. + private double? _totalUpdateSizeInByte; + + /// The total size of updates available for download in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public double? TotalUpdateSizeInByte { get => this._totalUpdateSizeInByte; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails[] _update; + + /// The list of updates available for install. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails[] Update { get => this._update; } + + /// Backing field for property. + private string[] _updateTitle; + + /// The list of updates available for install. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string[] UpdateTitle { get => this._updateTitle; } + + /// Creates an new instance. + public UpdateSummaryProperties() + { + + } + } + /// The device update information summary. + public partial interface IUpdateSummaryProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The last time when a scan was done on the device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The last time when a scan was done on the device.", + SerializedName = @"deviceLastScannedDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? DeviceLastScannedDateTime { get; set; } + /// The current version of the device in format: 1.2.17312.13.", + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The current version of the device in format: 1.2.17312.13."",", + SerializedName = @"deviceVersionNumber", + PossibleTypes = new [] { typeof(string) })] + string DeviceVersionNumber { get; set; } + /// The current version of the device in text format. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The current version of the device in text format.", + SerializedName = @"friendlyDeviceVersionName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyDeviceVersionName { get; set; } + /// The job ID of the download job in progress. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The job ID of the download job in progress.", + SerializedName = @"inProgressDownloadJobId", + PossibleTypes = new [] { typeof(string) })] + string InProgressDownloadJobId { get; } + /// The time when the currently running download (if any) started. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The time when the currently running download (if any) started.", + SerializedName = @"inProgressDownloadJobStartedDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? InProgressDownloadJobStartedDateTime { get; } + /// The job ID of the install job in progress. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The job ID of the install job in progress.", + SerializedName = @"inProgressInstallJobId", + PossibleTypes = new [] { typeof(string) })] + string InProgressInstallJobId { get; } + /// The time when the currently running install (if any) started. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The time when the currently running install (if any) started.", + SerializedName = @"inProgressInstallJobStartedDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? InProgressInstallJobStartedDateTime { get; } + /// + /// The time when the last Download job was completed (success/cancelled/failed) on the appliance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The time when the last Download job was completed (success/cancelled/failed) on the appliance.", + SerializedName = @"lastCompletedDownloadJobDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastCompletedDownloadJobDateTime { get; } + /// JobId of the last ran download job.(Can be success/cancelled/failed) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"JobId of the last ran download job.(Can be success/cancelled/failed)", + SerializedName = @"lastCompletedDownloadJobId", + PossibleTypes = new [] { typeof(string) })] + string LastCompletedDownloadJobId { get; } + /// + /// The time when the last Install job was completed (success/cancelled/failed) on the appliance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The time when the last Install job was completed (success/cancelled/failed) on the appliance.", + SerializedName = @"lastCompletedInstallJobDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastCompletedInstallJobDateTime { get; } + /// JobId of the last ran install job.(Can be success/cancelled/failed) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"JobId of the last ran install job.(Can be success/cancelled/failed)", + SerializedName = @"lastCompletedInstallJobId", + PossibleTypes = new [] { typeof(string) })] + string LastCompletedInstallJobId { get; } + /// + /// The time when the last scan job was completed (success/cancelled/failed) on the appliance. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the last scan job was completed (success/cancelled/failed) on the appliance.", + SerializedName = @"lastCompletedScanJobDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastCompletedScanJobDateTime { get; set; } + /// JobStatus of the last ran download job. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"JobStatus of the last ran download job.", + SerializedName = @"lastDownloadJobStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? LastDownloadJobStatus { get; } + /// JobStatus of the last ran install job. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"JobStatus of the last ran install job.", + SerializedName = @"lastInstallJobStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? LastInstallJobStatus { get; } + /// The time when the Last Install job was completed successfully on the appliance + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the Last Install job was completed successfully on the appliance", + SerializedName = @"lastSuccessfulInstallJobDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastSuccessfulInstallJobDateTime { get; set; } + /// Time when the last scan job is successfully completed. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time when the last scan job is successfully completed.", + SerializedName = @"lastSuccessfulScanJobTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastSuccessfulScanJobTime { get; set; } + /// The current update operation. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current update operation.", + SerializedName = @"ongoingUpdateOperation", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation? OngoingUpdateOperation { get; } + /// + /// Indicates if updates are available and at least one of the updates needs a reboot. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates if updates are available and at least one of the updates needs a reboot.", + SerializedName = @"rebootBehavior", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior? RebootBehavior { get; } + /// + /// The number of updates available for the current device version as per the last device scan. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The number of updates available for the current device version as per the last device scan.", + SerializedName = @"totalNumberOfUpdatesAvailable", + PossibleTypes = new [] { typeof(int) })] + int? TotalNumberOfUpdatesAvailable { get; } + /// The total number of items pending download. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The total number of items pending download.", + SerializedName = @"totalNumberOfUpdatesPendingDownload", + PossibleTypes = new [] { typeof(int) })] + int? TotalNumberOfUpdatesPendingDownload { get; } + /// The total number of items pending install. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The total number of items pending install.", + SerializedName = @"totalNumberOfUpdatesPendingInstall", + PossibleTypes = new [] { typeof(int) })] + int? TotalNumberOfUpdatesPendingInstall { get; } + /// The total time in Minutes + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The total time in Minutes", + SerializedName = @"totalTimeInMinutes", + PossibleTypes = new [] { typeof(int) })] + int? TotalTimeInMinute { get; } + /// The total size of updates available for download in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The total size of updates available for download in bytes.", + SerializedName = @"totalUpdateSizeInBytes", + PossibleTypes = new [] { typeof(double) })] + double? TotalUpdateSizeInByte { get; } + /// The list of updates available for install. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of updates available for install.", + SerializedName = @"updates", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails[] Update { get; } + /// The list of updates available for install. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of updates available for install.", + SerializedName = @"updateTitles", + PossibleTypes = new [] { typeof(string) })] + string[] UpdateTitle { get; } + + } + /// The device update information summary. + internal partial interface IUpdateSummaryPropertiesInternal + + { + /// The last time when a scan was done on the device. + global::System.DateTime? DeviceLastScannedDateTime { get; set; } + /// The current version of the device in format: 1.2.17312.13.", + string DeviceVersionNumber { get; set; } + /// The current version of the device in text format. + string FriendlyDeviceVersionName { get; set; } + /// The job ID of the download job in progress. + string InProgressDownloadJobId { get; set; } + /// The time when the currently running download (if any) started. + global::System.DateTime? InProgressDownloadJobStartedDateTime { get; set; } + /// The job ID of the install job in progress. + string InProgressInstallJobId { get; set; } + /// The time when the currently running install (if any) started. + global::System.DateTime? InProgressInstallJobStartedDateTime { get; set; } + /// + /// The time when the last Download job was completed (success/cancelled/failed) on the appliance. + /// + global::System.DateTime? LastCompletedDownloadJobDateTime { get; set; } + /// JobId of the last ran download job.(Can be success/cancelled/failed) + string LastCompletedDownloadJobId { get; set; } + /// + /// The time when the last Install job was completed (success/cancelled/failed) on the appliance. + /// + global::System.DateTime? LastCompletedInstallJobDateTime { get; set; } + /// JobId of the last ran install job.(Can be success/cancelled/failed) + string LastCompletedInstallJobId { get; set; } + /// + /// The time when the last scan job was completed (success/cancelled/failed) on the appliance. + /// + global::System.DateTime? LastCompletedScanJobDateTime { get; set; } + /// JobStatus of the last ran download job. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? LastDownloadJobStatus { get; set; } + /// JobStatus of the last ran install job. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus? LastInstallJobStatus { get; set; } + /// The time when the Last Install job was completed successfully on the appliance + global::System.DateTime? LastSuccessfulInstallJobDateTime { get; set; } + /// Time when the last scan job is successfully completed. + global::System.DateTime? LastSuccessfulScanJobTime { get; set; } + /// The current update operation. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation? OngoingUpdateOperation { get; set; } + /// + /// Indicates if updates are available and at least one of the updates needs a reboot. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior? RebootBehavior { get; set; } + /// + /// The number of updates available for the current device version as per the last device scan. + /// + int? TotalNumberOfUpdatesAvailable { get; set; } + /// The total number of items pending download. + int? TotalNumberOfUpdatesPendingDownload { get; set; } + /// The total number of items pending install. + int? TotalNumberOfUpdatesPendingInstall { get; set; } + /// The total time in Minutes + int? TotalTimeInMinute { get; set; } + /// The total size of updates available for download in bytes. + double? TotalUpdateSizeInByte { get; set; } + /// The list of updates available for install. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateDetails[] Update { get; set; } + /// The list of updates available for install. + string[] UpdateTitle { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummaryProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummaryProperties.json.cs new file mode 100644 index 000000000000..57bcfa88d3cd --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UpdateSummaryProperties.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The device update information summary. + public partial class UpdateSummaryProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummaryProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new UpdateSummaryProperties(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._deviceVersionNumber)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._deviceVersionNumber.ToString()) : null, "deviceVersionNumber" ,container.Add ); + AddIf( null != (((object)this._friendlyDeviceVersionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._friendlyDeviceVersionName.ToString()) : null, "friendlyDeviceVersionName" ,container.Add ); + AddIf( null != this._deviceLastScannedDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._deviceLastScannedDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "deviceLastScannedDateTime" ,container.Add ); + AddIf( null != this._lastCompletedScanJobDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._lastCompletedScanJobDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastCompletedScanJobDateTime" ,container.Add ); + AddIf( null != this._lastSuccessfulScanJobTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._lastSuccessfulScanJobTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastSuccessfulScanJobTime" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastCompletedDownloadJobDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._lastCompletedDownloadJobDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastCompletedDownloadJobDateTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._lastCompletedDownloadJobId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._lastCompletedDownloadJobId.ToString()) : null, "lastCompletedDownloadJobId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._lastDownloadJobStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._lastDownloadJobStatus.ToString()) : null, "lastDownloadJobStatus" ,container.Add ); + } + AddIf( null != this._lastSuccessfulInstallJobDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._lastSuccessfulInstallJobDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastSuccessfulInstallJobDateTime" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastCompletedInstallJobDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._lastCompletedInstallJobDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastCompletedInstallJobDateTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._lastCompletedInstallJobId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._lastCompletedInstallJobId.ToString()) : null, "lastCompletedInstallJobId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._lastInstallJobStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._lastInstallJobStatus.ToString()) : null, "lastInstallJobStatus" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalNumberOfUpdatesAvailable ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._totalNumberOfUpdatesAvailable) : null, "totalNumberOfUpdatesAvailable" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalNumberOfUpdatesPendingDownload ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._totalNumberOfUpdatesPendingDownload) : null, "totalNumberOfUpdatesPendingDownload" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalNumberOfUpdatesPendingInstall ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._totalNumberOfUpdatesPendingInstall) : null, "totalNumberOfUpdatesPendingInstall" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._rebootBehavior)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._rebootBehavior.ToString()) : null, "rebootBehavior" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._ongoingUpdateOperation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._ongoingUpdateOperation.ToString()) : null, "ongoingUpdateOperation" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._inProgressDownloadJobId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._inProgressDownloadJobId.ToString()) : null, "inProgressDownloadJobId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._inProgressInstallJobId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._inProgressInstallJobId.ToString()) : null, "inProgressInstallJobId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._inProgressDownloadJobStartedDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._inProgressDownloadJobStartedDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "inProgressDownloadJobStartedDateTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._inProgressInstallJobStartedDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._inProgressInstallJobStartedDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "inProgressInstallJobStartedDateTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._updateTitle) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._updateTitle ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("updateTitles",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._update) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __s in this._update ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("updates",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalUpdateSizeInByte ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((double)this._totalUpdateSizeInByte) : null, "totalUpdateSizeInBytes" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._totalTimeInMinute ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((int)this._totalTimeInMinute) : null, "totalTimeInMinutes" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal UpdateSummaryProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_deviceVersionNumber = If( json?.PropertyT("deviceVersionNumber"), out var __jsonDeviceVersionNumber) ? (string)__jsonDeviceVersionNumber : (string)DeviceVersionNumber;} + {_friendlyDeviceVersionName = If( json?.PropertyT("friendlyDeviceVersionName"), out var __jsonFriendlyDeviceVersionName) ? (string)__jsonFriendlyDeviceVersionName : (string)FriendlyDeviceVersionName;} + {_deviceLastScannedDateTime = If( json?.PropertyT("deviceLastScannedDateTime"), out var __jsonDeviceLastScannedDateTime) ? global::System.DateTime.TryParse((string)__jsonDeviceLastScannedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonDeviceLastScannedDateTimeValue) ? __jsonDeviceLastScannedDateTimeValue : DeviceLastScannedDateTime : DeviceLastScannedDateTime;} + {_lastCompletedScanJobDateTime = If( json?.PropertyT("lastCompletedScanJobDateTime"), out var __jsonLastCompletedScanJobDateTime) ? global::System.DateTime.TryParse((string)__jsonLastCompletedScanJobDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastCompletedScanJobDateTimeValue) ? __jsonLastCompletedScanJobDateTimeValue : LastCompletedScanJobDateTime : LastCompletedScanJobDateTime;} + {_lastSuccessfulScanJobTime = If( json?.PropertyT("lastSuccessfulScanJobTime"), out var __jsonLastSuccessfulScanJobTime) ? global::System.DateTime.TryParse((string)__jsonLastSuccessfulScanJobTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastSuccessfulScanJobTimeValue) ? __jsonLastSuccessfulScanJobTimeValue : LastSuccessfulScanJobTime : LastSuccessfulScanJobTime;} + {_lastCompletedDownloadJobDateTime = If( json?.PropertyT("lastCompletedDownloadJobDateTime"), out var __jsonLastCompletedDownloadJobDateTime) ? global::System.DateTime.TryParse((string)__jsonLastCompletedDownloadJobDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastCompletedDownloadJobDateTimeValue) ? __jsonLastCompletedDownloadJobDateTimeValue : LastCompletedDownloadJobDateTime : LastCompletedDownloadJobDateTime;} + {_lastCompletedDownloadJobId = If( json?.PropertyT("lastCompletedDownloadJobId"), out var __jsonLastCompletedDownloadJobId) ? (string)__jsonLastCompletedDownloadJobId : (string)LastCompletedDownloadJobId;} + {_lastDownloadJobStatus = If( json?.PropertyT("lastDownloadJobStatus"), out var __jsonLastDownloadJobStatus) ? (string)__jsonLastDownloadJobStatus : (string)LastDownloadJobStatus;} + {_lastSuccessfulInstallJobDateTime = If( json?.PropertyT("lastSuccessfulInstallJobDateTime"), out var __jsonLastSuccessfulInstallJobDateTime) ? global::System.DateTime.TryParse((string)__jsonLastSuccessfulInstallJobDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastSuccessfulInstallJobDateTimeValue) ? __jsonLastSuccessfulInstallJobDateTimeValue : LastSuccessfulInstallJobDateTime : LastSuccessfulInstallJobDateTime;} + {_lastCompletedInstallJobDateTime = If( json?.PropertyT("lastCompletedInstallJobDateTime"), out var __jsonLastCompletedInstallJobDateTime) ? global::System.DateTime.TryParse((string)__jsonLastCompletedInstallJobDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastCompletedInstallJobDateTimeValue) ? __jsonLastCompletedInstallJobDateTimeValue : LastCompletedInstallJobDateTime : LastCompletedInstallJobDateTime;} + {_lastCompletedInstallJobId = If( json?.PropertyT("lastCompletedInstallJobId"), out var __jsonLastCompletedInstallJobId) ? (string)__jsonLastCompletedInstallJobId : (string)LastCompletedInstallJobId;} + {_lastInstallJobStatus = If( json?.PropertyT("lastInstallJobStatus"), out var __jsonLastInstallJobStatus) ? (string)__jsonLastInstallJobStatus : (string)LastInstallJobStatus;} + {_totalNumberOfUpdatesAvailable = If( json?.PropertyT("totalNumberOfUpdatesAvailable"), out var __jsonTotalNumberOfUpdatesAvailable) ? (int?)__jsonTotalNumberOfUpdatesAvailable : TotalNumberOfUpdatesAvailable;} + {_totalNumberOfUpdatesPendingDownload = If( json?.PropertyT("totalNumberOfUpdatesPendingDownload"), out var __jsonTotalNumberOfUpdatesPendingDownload) ? (int?)__jsonTotalNumberOfUpdatesPendingDownload : TotalNumberOfUpdatesPendingDownload;} + {_totalNumberOfUpdatesPendingInstall = If( json?.PropertyT("totalNumberOfUpdatesPendingInstall"), out var __jsonTotalNumberOfUpdatesPendingInstall) ? (int?)__jsonTotalNumberOfUpdatesPendingInstall : TotalNumberOfUpdatesPendingInstall;} + {_rebootBehavior = If( json?.PropertyT("rebootBehavior"), out var __jsonRebootBehavior) ? (string)__jsonRebootBehavior : (string)RebootBehavior;} + {_ongoingUpdateOperation = If( json?.PropertyT("ongoingUpdateOperation"), out var __jsonOngoingUpdateOperation) ? (string)__jsonOngoingUpdateOperation : (string)OngoingUpdateOperation;} + {_inProgressDownloadJobId = If( json?.PropertyT("inProgressDownloadJobId"), out var __jsonInProgressDownloadJobId) ? (string)__jsonInProgressDownloadJobId : (string)InProgressDownloadJobId;} + {_inProgressInstallJobId = If( json?.PropertyT("inProgressInstallJobId"), out var __jsonInProgressInstallJobId) ? (string)__jsonInProgressInstallJobId : (string)InProgressInstallJobId;} + {_inProgressDownloadJobStartedDateTime = If( json?.PropertyT("inProgressDownloadJobStartedDateTime"), out var __jsonInProgressDownloadJobStartedDateTime) ? global::System.DateTime.TryParse((string)__jsonInProgressDownloadJobStartedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonInProgressDownloadJobStartedDateTimeValue) ? __jsonInProgressDownloadJobStartedDateTimeValue : InProgressDownloadJobStartedDateTime : InProgressDownloadJobStartedDateTime;} + {_inProgressInstallJobStartedDateTime = If( json?.PropertyT("inProgressInstallJobStartedDateTime"), out var __jsonInProgressInstallJobStartedDateTime) ? global::System.DateTime.TryParse((string)__jsonInProgressInstallJobStartedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonInProgressInstallJobStartedDateTimeValue) ? __jsonInProgressInstallJobStartedDateTimeValue : InProgressInstallJobStartedDateTime : InProgressInstallJobStartedDateTime;} + {_updateTitle = If( json?.PropertyT("updateTitles"), out var __jsonUpdateTitles) ? If( __jsonUpdateTitles as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : UpdateTitle;} + {_update = If( json?.PropertyT("updates"), out var __jsonUpdates) ? If( __jsonUpdates as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IUpdateDetails) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UpdateDetails.FromJson(__p) )) ))() : null : Update;} + {_totalUpdateSizeInByte = If( json?.PropertyT("totalUpdateSizeInBytes"), out var __jsonTotalUpdateSizeInBytes) ? (double?)__jsonTotalUpdateSizeInBytes : TotalUpdateSizeInByte;} + {_totalTimeInMinute = If( json?.PropertyT("totalTimeInMinutes"), out var __jsonTotalTimeInMinutes) ? (int?)__jsonTotalTimeInMinutes : TotalTimeInMinute;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateRequest.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateRequest.PowerShell.cs new file mode 100644 index 000000000000..de625bc4b375 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateRequest.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The upload certificate request. + [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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IUploadCertificateRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateData) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RawCertificateDataTypeConverter.ConvertFrom); + } + if (content.Contains("AuthenticationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequestInternal)this).AuthenticationType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType?) content.GetValueForProperty("AuthenticationType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequestInternal)this).AuthenticationType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("Certificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequestInternal)this).Certificate = (string) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IUploadCertificateRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateData) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RawCertificateDataTypeConverter.ConvertFrom); + } + if (content.Contains("AuthenticationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequestInternal)this).AuthenticationType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType?) content.GetValueForProperty("AuthenticationType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequestInternal)this).AuthenticationType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("Certificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequestInternal)this).Certificate = (string) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequestInternal)this).Certificate, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// The upload certificate request. + [System.ComponentModel.TypeConverter(typeof(UploadCertificateRequestTypeConverter))] + public partial interface IUploadCertificateRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateRequest.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateRequest.TypeConverter.cs new file mode 100644 index 000000000000..98df2d1a72f2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/UploadCertificateRequest.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateRequest.cs new file mode 100644 index 000000000000..e8408ac34dcc --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateRequest.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The upload certificate request. + public partial class UploadCertificateRequest : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequestInternal + { + + /// The authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType? AuthenticationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateDataInternal)Property).AuthenticationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateDataInternal)Property).AuthenticationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType)""); } + + /// The base64 encoded certificate raw data. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string Certificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateDataInternal)Property).Certificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateDataInternal)Property).Certificate = value ; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RawCertificateData()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateData _property; + + /// The Base 64 encoded certificate raw data. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateData Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.RawCertificateData()); set => this._property = value; } + + /// Creates an new instance. + public UploadCertificateRequest() + { + + } + } + /// The upload certificate request. + public partial interface IUploadCertificateRequest : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The authentication type.", + SerializedName = @"authenticationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType? AuthenticationType { get; set; } + /// The base64 encoded certificate raw data. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The base64 encoded certificate raw data.", + SerializedName = @"certificate", + PossibleTypes = new [] { typeof(string) })] + string Certificate { get; set; } + + } + /// The upload certificate request. + internal partial interface IUploadCertificateRequestInternal + + { + /// The authentication type. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType? AuthenticationType { get; set; } + /// The base64 encoded certificate raw data. + string Certificate { get; set; } + /// The Base 64 encoded certificate raw data. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRawCertificateData Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateRequest.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateRequest.json.cs new file mode 100644 index 000000000000..3b94fcc32816 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateRequest.json.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The upload certificate request. + 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal UploadCertificateRequest(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.RawCertificateData.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateResponse.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateResponse.PowerShell.cs new file mode 100644 index 000000000000..07db9c1d625b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateResponse.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The upload registration certificate response. + [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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.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.DataBoxEdge.Models.Api20220301.IUploadCertificateResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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("AuthType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType?) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("AadAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AadAuthority = (string) content.GetValueForProperty("AadAuthority",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AadAuthority, global::System.Convert.ToString); + } + if (content.Contains("AadTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AadTenantId = (string) content.GetValueForProperty("AadTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AadTenantId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).ServicePrincipalClientId = (string) content.GetValueForProperty("ServicePrincipalClientId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).ServicePrincipalClientId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).ServicePrincipalObjectId = (string) content.GetValueForProperty("ServicePrincipalObjectId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).ServicePrincipalObjectId, global::System.Convert.ToString); + } + if (content.Contains("AzureManagementEndpointAudience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AzureManagementEndpointAudience = (string) content.GetValueForProperty("AzureManagementEndpointAudience",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AzureManagementEndpointAudience, global::System.Convert.ToString); + } + if (content.Contains("AadAudience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AadAudience = (string) content.GetValueForProperty("AadAudience",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AadAudience, 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("AuthType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType?) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType.CreateFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("AadAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AadAuthority = (string) content.GetValueForProperty("AadAuthority",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AadAuthority, global::System.Convert.ToString); + } + if (content.Contains("AadTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AadTenantId = (string) content.GetValueForProperty("AadTenantId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AadTenantId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).ServicePrincipalClientId = (string) content.GetValueForProperty("ServicePrincipalClientId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).ServicePrincipalClientId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).ServicePrincipalObjectId = (string) content.GetValueForProperty("ServicePrincipalObjectId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).ServicePrincipalObjectId, global::System.Convert.ToString); + } + if (content.Contains("AzureManagementEndpointAudience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AzureManagementEndpointAudience = (string) content.GetValueForProperty("AzureManagementEndpointAudience",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AzureManagementEndpointAudience, global::System.Convert.ToString); + } + if (content.Contains("AadAudience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AadAudience = (string) content.GetValueForProperty("AadAudience",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal)this).AadAudience, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// The upload registration certificate response. + [System.ComponentModel.TypeConverter(typeof(UploadCertificateResponseTypeConverter))] + public partial interface IUploadCertificateResponse + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateResponse.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateResponse.TypeConverter.cs new file mode 100644 index 000000000000..ff353c32dc89 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IUploadCertificateResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.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/databoxedge/generated/api/Models/Api20220301/UploadCertificateResponse.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateResponse.cs new file mode 100644 index 000000000000..5a411b04f4c0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateResponse.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The upload registration certificate response. + public partial class UploadCertificateResponse : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponse, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal + { + + /// Backing field for property. + private string _aadAudience; + + /// Identifier of the target resource that is the recipient of the requested token. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string AadAudience { get => this._aadAudience; } + + /// Backing field for property. + private string _aadAuthority; + + /// Azure Active Directory tenant authority. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string AadAuthority { get => this._aadAuthority; } + + /// Backing field for property. + private string _aadTenantId; + + /// Azure Active Directory tenant ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string AadTenantId { get => this._aadTenantId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType? _authType; + + /// Specifies authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType? AuthType { get => this._authType; set => this._authType = value; } + + /// Backing field for property. + private string _azureManagementEndpointAudience; + + /// The azure management endpoint audience. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string AzureManagementEndpointAudience { get => this._azureManagementEndpointAudience; } + + /// Internal Acessors for AadAudience + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal.AadAudience { get => this._aadAudience; set { {_aadAudience = value;} } } + + /// Internal Acessors for AadAuthority + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal.AadAuthority { get => this._aadAuthority; set { {_aadAuthority = value;} } } + + /// Internal Acessors for AadTenantId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal.AadTenantId { get => this._aadTenantId; set { {_aadTenantId = value;} } } + + /// Internal Acessors for AzureManagementEndpointAudience + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal.AzureManagementEndpointAudience { get => this._azureManagementEndpointAudience; set { {_azureManagementEndpointAudience = value;} } } + + /// Internal Acessors for ResourceId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal.ResourceId { get => this._resourceId; set { {_resourceId = value;} } } + + /// Internal Acessors for ServicePrincipalClientId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal.ServicePrincipalClientId { get => this._servicePrincipalClientId; set { {_servicePrincipalClientId = value;} } } + + /// Internal Acessors for ServicePrincipalObjectId + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponseInternal.ServicePrincipalObjectId { get => this._servicePrincipalObjectId; set { {_servicePrincipalObjectId = value;} } } + + /// Backing field for property. + private string _resourceId; + + /// The resource ID of the Data Box Edge/Gateway device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; } + + /// Backing field for property. + private string _servicePrincipalClientId; + + /// Azure Active Directory service principal client ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ServicePrincipalClientId { get => this._servicePrincipalClientId; } + + /// Backing field for property. + private string _servicePrincipalObjectId; + + /// Azure Active Directory service principal object ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ServicePrincipalObjectId { get => this._servicePrincipalObjectId; } + + /// Creates an new instance. + public UploadCertificateResponse() + { + + } + } + /// The upload registration certificate response. + public partial interface IUploadCertificateResponse : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Identifier of the target resource that is the recipient of the requested token. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Identifier of the target resource that is the recipient of the requested token.", + SerializedName = @"aadAudience", + PossibleTypes = new [] { typeof(string) })] + string AadAudience { get; } + /// Azure Active Directory tenant authority. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure Active Directory tenant authority.", + SerializedName = @"aadAuthority", + PossibleTypes = new [] { typeof(string) })] + string AadAuthority { get; } + /// Azure Active Directory tenant ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure Active Directory tenant ID.", + SerializedName = @"aadTenantId", + PossibleTypes = new [] { typeof(string) })] + string AadTenantId { get; } + /// Specifies authentication type. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies authentication type.", + SerializedName = @"authType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType? AuthType { get; set; } + /// The azure management endpoint audience. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The azure management endpoint audience.", + SerializedName = @"azureManagementEndpointAudience", + PossibleTypes = new [] { typeof(string) })] + string AzureManagementEndpointAudience { get; } + /// The resource ID of the Data Box Edge/Gateway device. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The resource ID of the Data Box Edge/Gateway device.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; } + /// Azure Active Directory service principal client ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure Active Directory service principal client ID.", + SerializedName = @"servicePrincipalClientId", + PossibleTypes = new [] { typeof(string) })] + string ServicePrincipalClientId { get; } + /// Azure Active Directory service principal object ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Azure Active Directory service principal object ID.", + SerializedName = @"servicePrincipalObjectId", + PossibleTypes = new [] { typeof(string) })] + string ServicePrincipalObjectId { get; } + + } + /// The upload registration certificate response. + internal partial interface IUploadCertificateResponseInternal + + { + /// Identifier of the target resource that is the recipient of the requested token. + string AadAudience { get; set; } + /// Azure Active Directory tenant authority. + string AadAuthority { get; set; } + /// Azure Active Directory tenant ID. + string AadTenantId { get; set; } + /// Specifies authentication type. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType? AuthType { get; set; } + /// The azure management endpoint audience. + string AzureManagementEndpointAudience { get; set; } + /// The resource ID of the Data Box Edge/Gateway device. + string ResourceId { get; set; } + /// Azure Active Directory service principal client ID. + string ServicePrincipalClientId { get; set; } + /// Azure Active Directory service principal object ID. + string ServicePrincipalObjectId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateResponse.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateResponse.json.cs new file mode 100644 index 000000000000..3cbe5b0f56b5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UploadCertificateResponse.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The upload registration certificate response. + 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._authType.ToString()) : null, "authType" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._aadAuthority)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._aadAuthority.ToString()) : null, "aadAuthority" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._aadTenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._aadTenantId.ToString()) : null, "aadTenantId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._servicePrincipalClientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._servicePrincipalClientId.ToString()) : null, "servicePrincipalClientId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._servicePrincipalObjectId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._servicePrincipalObjectId.ToString()) : null, "servicePrincipalObjectId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._azureManagementEndpointAudience)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._azureManagementEndpointAudience.ToString()) : null, "azureManagementEndpointAudience" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._aadAudience)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._aadAudience.ToString()) : null, "aadAudience" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal UploadCertificateResponse(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)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;} + {_aadAudience = If( json?.PropertyT("aadAudience"), out var __jsonAadAudience) ? (string)__jsonAadAudience : (string)AadAudience;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/User.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/User.PowerShell.cs new file mode 100644 index 000000000000..5204837dbcf3 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/User.PowerShell.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// Represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + /// + [System.ComponentModel.TypeConverter(typeof(UserTypeConverter))] + public partial class User + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IUser DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new User(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.DataBoxEdge.Models.Api20220301.IUser DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new User(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.DataBoxEdge.Models.Api20220301.IUser FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal User(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.DataBoxEdge.Models.Api20220301.IUserInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UserPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("UserType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).UserType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType) content.GetValueForProperty("UserType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).UserType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType.CreateFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EncryptedPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).EncryptedPassword = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("EncryptedPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).EncryptedPassword, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ShareAccessRights")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).ShareAccessRights = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight[]) content.GetValueForProperty("ShareAccessRights",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).ShareAccessRights, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ShareAccessRightTypeConverter.ConvertFrom)); + } + if (content.Contains("EncryptedPasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).EncryptedPasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("EncryptedPasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).EncryptedPasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EncryptedPasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).EncryptedPasswordValue = (string) content.GetValueForProperty("EncryptedPasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).EncryptedPasswordValue, global::System.Convert.ToString); + } + if (content.Contains("EncryptedPasswordEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).EncryptedPasswordEncryptionCertThumbprint = (string) content.GetValueForProperty("EncryptedPasswordEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).EncryptedPasswordEncryptionCertThumbprint, 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 User(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.DataBoxEdge.Models.Api20220301.IUserInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UserPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("UserType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).UserType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType) content.GetValueForProperty("UserType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).UserType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType.CreateFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EncryptedPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).EncryptedPassword = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("EncryptedPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).EncryptedPassword, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ShareAccessRights")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).ShareAccessRights = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight[]) content.GetValueForProperty("ShareAccessRights",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).ShareAccessRights, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ShareAccessRightTypeConverter.ConvertFrom)); + } + if (content.Contains("EncryptedPasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).EncryptedPasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("EncryptedPasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).EncryptedPasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EncryptedPasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).EncryptedPasswordValue = (string) content.GetValueForProperty("EncryptedPasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).EncryptedPasswordValue, global::System.Convert.ToString); + } + if (content.Contains("EncryptedPasswordEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).EncryptedPasswordEncryptionCertThumbprint = (string) content.GetValueForProperty("EncryptedPasswordEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal)this).EncryptedPasswordEncryptionCertThumbprint, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(UserTypeConverter))] + public partial interface IUser + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/User.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/User.TypeConverter.cs new file mode 100644 index 000000000000..18a88da160d2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/User.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UserTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IUser ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return User.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return User.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return User.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/databoxedge/generated/api/Models/Api20220301/User.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/User.cs new file mode 100644 index 000000000000..4aeb24f92a95 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/User.cs @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// Represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + /// + public partial class User : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(); + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? EncryptedPasswordEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)Property).EncryptedPasswordEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)Property).EncryptedPasswordEncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string EncryptedPasswordEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)Property).EncryptedPasswordEncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)Property).EncryptedPasswordEncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string EncryptedPasswordValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)Property).EncryptedPasswordValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)Property).EncryptedPasswordValue = value ?? null; } + + /// The path ID that uniquely identifies the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type = value; } + + /// Internal Acessors for EncryptedPassword + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal.EncryptedPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)Property).EncryptedPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)Property).EncryptedPassword = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserProperties Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UserProperties()); set { {_property = value;} } } + + /// Internal Acessors for ShareAccessRights + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal.ShareAccessRights { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)Property).ShareAccessRights; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)Property).ShareAccessRights = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// The object name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserProperties _property; + + /// The storage account credential properties. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UserProperties()); set => this._property = value; } + + /// + /// List of shares that the user has rights on. This field should not be specified during user creation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight[] ShareAccessRights { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)Property).ShareAccessRights; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of User + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType)""); } + + /// The hierarchical type of the object. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal)__armBaseModel).Type; } + + /// Type of the user. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType UserType { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)Property).UserType; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)Property).UserType = value ; } + + /// Creates an new instance. + public User() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__armBaseModel), __armBaseModel); + await eventListener.AssertObjectIsValid(nameof(__armBaseModel), __armBaseModel); + } + } + /// Represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + public partial interface IUser : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModel + { + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? EncryptedPasswordEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string EncryptedPasswordEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string EncryptedPasswordValue { get; set; } + /// + /// List of shares that the user has rights on. This field should not be specified during user creation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of shares that the user has rights on. This field should not be specified during user creation.", + SerializedName = @"shareAccessRights", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight[] ShareAccessRights { get; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Type of the user. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of the user.", + SerializedName = @"userType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType UserType { get; set; } + + } + /// Represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + internal partial interface IUserInternal : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IArmBaseModelInternal + { + /// The password details. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret EncryptedPassword { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? EncryptedPasswordEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string EncryptedPasswordEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string EncryptedPasswordValue { get; set; } + /// The storage account credential properties. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserProperties Property { get; set; } + /// + /// List of shares that the user has rights on. This field should not be specified during user creation. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight[] ShareAccessRights { get; set; } + /// Metadata pertaining to creation and last modification of User + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// Type of the user. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType UserType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/User.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/User.json.cs new file mode 100644 index 000000000000..886e64911103 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/User.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// Represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + /// + public partial class User + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new User(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __armBaseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal User(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __armBaseModel = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ArmBaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UserProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UserAccessRight.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserAccessRight.PowerShell.cs new file mode 100644 index 000000000000..393351e30564 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserAccessRight.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The mapping between a particular user and the access type on the SMB share. + [System.ComponentModel.TypeConverter(typeof(UserAccessRightTypeConverter))] + public partial class UserAccessRight + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IUserAccessRight DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UserAccessRight(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.DataBoxEdge.Models.Api20220301.IUserAccessRight DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UserAccessRight(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.DataBoxEdge.Models.Api20220301.IUserAccessRight FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UserAccessRight(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("UserId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRightInternal)this).UserId = (string) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRightInternal)this).UserId, global::System.Convert.ToString); + } + if (content.Contains("AccessType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRightInternal)this).AccessType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType) content.GetValueForProperty("AccessType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRightInternal)this).AccessType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UserAccessRight(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("UserId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRightInternal)this).UserId = (string) content.GetValueForProperty("UserId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRightInternal)this).UserId, global::System.Convert.ToString); + } + if (content.Contains("AccessType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRightInternal)this).AccessType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType) content.GetValueForProperty("AccessType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRightInternal)this).AccessType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType.CreateFrom); + } + AfterDeserializePSObject(content); + } + } + /// The mapping between a particular user and the access type on the SMB share. + [System.ComponentModel.TypeConverter(typeof(UserAccessRightTypeConverter))] + public partial interface IUserAccessRight + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UserAccessRight.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserAccessRight.TypeConverter.cs new file mode 100644 index 000000000000..d92b2a28fc6d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserAccessRight.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UserAccessRightTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IUserAccessRight ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UserAccessRight.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UserAccessRight.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UserAccessRight.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/databoxedge/generated/api/Models/Api20220301/UserAccessRight.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserAccessRight.cs new file mode 100644 index 000000000000..1daf19534c26 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserAccessRight.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The mapping between a particular user and the access type on the SMB share. + public partial class UserAccessRight : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRightInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType _accessType; + + /// Type of access to be allowed for the user. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType AccessType { get => this._accessType; set => this._accessType = value; } + + /// Backing field for property. + private string _userId; + + /// User ID (already existing in the device). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string UserId { get => this._userId; set => this._userId = value; } + + /// Creates an new instance. + public UserAccessRight() + { + + } + } + /// The mapping between a particular user and the access type on the SMB share. + public partial interface IUserAccessRight : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Type of access to be allowed for the user. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of access to be allowed for the user.", + SerializedName = @"accessType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType AccessType { get; set; } + /// User ID (already existing in the device). + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"User ID (already existing in the device).", + SerializedName = @"userId", + PossibleTypes = new [] { typeof(string) })] + string UserId { get; set; } + + } + /// The mapping between a particular user and the access type on the SMB share. + internal partial interface IUserAccessRightInternal + + { + /// Type of access to be allowed for the user. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType AccessType { get; set; } + /// User ID (already existing in the device). + string UserId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UserAccessRight.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserAccessRight.json.cs new file mode 100644 index 000000000000..75dac849633d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserAccessRight.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The mapping between a particular user and the access type on the SMB share. + public partial class UserAccessRight + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new UserAccessRight(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._userId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._userId.ToString()) : null, "userId" ,container.Add ); + AddIf( null != (((object)this._accessType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._accessType.ToString()) : null, "accessType" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal UserAccessRight(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_userId = If( json?.PropertyT("userId"), out var __jsonUserId) ? (string)__jsonUserId : (string)UserId;} + {_accessType = If( json?.PropertyT("accessType"), out var __jsonAccessType) ? (string)__jsonAccessType : (string)AccessType;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UserList.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserList.PowerShell.cs new file mode 100644 index 000000000000..7bc70535736b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// Collection of users. + [System.ComponentModel.TypeConverter(typeof(UserListTypeConverter))] + public partial class UserList + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IUserList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UserList(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.DataBoxEdge.Models.Api20220301.IUserList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UserList(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.DataBoxEdge.Models.Api20220301.IUserList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UserList(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.DataBoxEdge.Models.Api20220301.IUserListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UserTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserListInternal)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 UserList(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.DataBoxEdge.Models.Api20220301.IUserListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UserTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Collection of users. + [System.ComponentModel.TypeConverter(typeof(UserListTypeConverter))] + public partial interface IUserList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UserList.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserList.TypeConverter.cs new file mode 100644 index 000000000000..976007ac399d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserList.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UserListTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IUserList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UserList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UserList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UserList.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/databoxedge/generated/api/Models/Api20220301/UserList.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserList.cs new file mode 100644 index 000000000000..48588bae7c74 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserList.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Collection of users. + public partial class UserList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserList, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserListInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser[] _value; + + /// The list of users. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser[] Value { get => this._value; } + + /// Creates an new instance. + public UserList() + { + + } + } + /// Collection of users. + public partial interface IUserList : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Link to the next set of results. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Link to the next set of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of users. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of users.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser[] Value { get; } + + } + /// Collection of users. + internal partial interface IUserListInternal + + { + /// Link to the next set of results. + string NextLink { get; set; } + /// The list of users. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UserList.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserList.json.cs new file mode 100644 index 000000000000..d8c058cfdd9a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserList.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// Collection of users. + public partial class UserList + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserList FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new UserList(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal UserList(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IUser) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.User.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UserProperties.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserProperties.PowerShell.cs new file mode 100644 index 000000000000..f17d3b043633 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserProperties.PowerShell.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// The user properties. + [System.ComponentModel.TypeConverter(typeof(UserPropertiesTypeConverter))] + public partial class UserProperties + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IUserProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UserProperties(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.DataBoxEdge.Models.Api20220301.IUserProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UserProperties(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.DataBoxEdge.Models.Api20220301.IUserProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UserProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EncryptedPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).EncryptedPassword = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("EncryptedPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).EncryptedPassword, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ShareAccessRights")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).ShareAccessRights = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight[]) content.GetValueForProperty("ShareAccessRights",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).ShareAccessRights, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ShareAccessRightTypeConverter.ConvertFrom)); + } + if (content.Contains("UserType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).UserType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType) content.GetValueForProperty("UserType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).UserType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType.CreateFrom); + } + if (content.Contains("EncryptedPasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).EncryptedPasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("EncryptedPasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).EncryptedPasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("EncryptedPasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).EncryptedPasswordValue = (string) content.GetValueForProperty("EncryptedPasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).EncryptedPasswordValue, global::System.Convert.ToString); + } + if (content.Contains("EncryptedPasswordEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).EncryptedPasswordEncryptionCertThumbprint = (string) content.GetValueForProperty("EncryptedPasswordEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).EncryptedPasswordEncryptionCertThumbprint, 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 UserProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EncryptedPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).EncryptedPassword = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret) content.GetValueForProperty("EncryptedPassword",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).EncryptedPassword, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("ShareAccessRights")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).ShareAccessRights = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight[]) content.GetValueForProperty("ShareAccessRights",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).ShareAccessRights, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ShareAccessRightTypeConverter.ConvertFrom)); + } + if (content.Contains("UserType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).UserType = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType) content.GetValueForProperty("UserType",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).UserType, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType.CreateFrom); + } + if (content.Contains("EncryptedPasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).EncryptedPasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) content.GetValueForProperty("EncryptedPasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).EncryptedPasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("EncryptedPasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).EncryptedPasswordValue = (string) content.GetValueForProperty("EncryptedPasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).EncryptedPasswordValue, global::System.Convert.ToString); + } + if (content.Contains("EncryptedPasswordEncryptionCertThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).EncryptedPasswordEncryptionCertThumbprint = (string) content.GetValueForProperty("EncryptedPasswordEncryptionCertThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal)this).EncryptedPasswordEncryptionCertThumbprint, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// The user properties. + [System.ComponentModel.TypeConverter(typeof(UserPropertiesTypeConverter))] + public partial interface IUserProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UserProperties.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserProperties.TypeConverter.cs new file mode 100644 index 000000000000..2a4c71b8e449 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserProperties.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UserPropertiesTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IUserProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UserProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UserProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UserProperties.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/databoxedge/generated/api/Models/Api20220301/UserProperties.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserProperties.cs new file mode 100644 index 000000000000..aef0368d44bd --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserProperties.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The user properties. + public partial class UserProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserProperties, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret _encryptedPassword; + + /// The password details. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret EncryptedPassword { get => (this._encryptedPassword = this._encryptedPassword ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret()); set => this._encryptedPassword = value; } + + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? EncryptedPasswordEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)EncryptedPassword).EncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)EncryptedPassword).EncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string EncryptedPasswordEncryptionCertThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)EncryptedPassword).EncryptionCertThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)EncryptedPassword).EncryptionCertThumbprint = value ?? null; } + + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Inlined)] + public string EncryptedPasswordValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)EncryptedPassword).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecretInternal)EncryptedPassword).Value = value ?? null; } + + /// Internal Acessors for EncryptedPassword + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal.EncryptedPassword { get => (this._encryptedPassword = this._encryptedPassword ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret()); set { {_encryptedPassword = value;} } } + + /// Internal Acessors for ShareAccessRights + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight[] Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserPropertiesInternal.ShareAccessRights { get => this._shareAccessRights; set { {_shareAccessRights = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight[] _shareAccessRights; + + /// + /// List of shares that the user has rights on. This field should not be specified during user creation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight[] ShareAccessRights { get => this._shareAccessRights; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType _userType; + + /// Type of the user. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType UserType { get => this._userType; set => this._userType = value; } + + /// Creates an new instance. + public UserProperties() + { + + } + } + /// The user properties. + public partial interface IUserProperties : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The algorithm used to encrypt "Value". + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? EncryptedPasswordEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + string EncryptedPasswordEncryptionCertThumbprint { get; set; } + /// The value of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string EncryptedPasswordValue { get; set; } + /// + /// List of shares that the user has rights on. This field should not be specified during user creation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of shares that the user has rights on. This field should not be specified during user creation.", + SerializedName = @"shareAccessRights", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight[] ShareAccessRights { get; } + /// Type of the user. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of the user.", + SerializedName = @"userType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType) })] + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType UserType { get; set; } + + } + /// The user properties. + internal partial interface IUserPropertiesInternal + + { + /// The password details. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAsymmetricEncryptedSecret EncryptedPassword { get; set; } + /// The algorithm used to encrypt "Value". + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm? EncryptedPasswordEncryptionAlgorithm { get; set; } + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + string EncryptedPasswordEncryptionCertThumbprint { get; set; } + /// The value of the secret. + string EncryptedPasswordValue { get; set; } + /// + /// List of shares that the user has rights on. This field should not be specified during user creation. + /// + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShareAccessRight[] ShareAccessRights { get; set; } + /// Type of the user. + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType UserType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/UserProperties.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserProperties.json.cs new file mode 100644 index 000000000000..452993064788 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/UserProperties.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// The user properties. + public partial class UserProperties + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new UserProperties(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._encryptedPassword ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) this._encryptedPassword.ToJson(null,serializationMode) : null, "encryptedPassword" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._shareAccessRights) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._shareAccessRights ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("shareAccessRights",__w); + } + } + AddIf( null != (((object)this._userType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._userType.ToString()) : null, "userType" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal UserProperties(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_encryptedPassword = If( json?.PropertyT("encryptedPassword"), out var __jsonEncryptedPassword) ? Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.AsymmetricEncryptedSecret.FromJson(__jsonEncryptedPassword) : EncryptedPassword;} + {_shareAccessRights = If( json?.PropertyT("shareAccessRights"), out var __jsonShareAccessRights) ? If( __jsonShareAccessRights as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Models.Api20220301.IShareAccessRight) (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ShareAccessRight.FromJson(__u) )) ))() : null : ShareAccessRights;} + {_userType = If( json?.PropertyT("userType"), out var __jsonUserType) ? (string)__jsonUserType : (string)UserType;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/VMMemory.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/VMMemory.PowerShell.cs new file mode 100644 index 000000000000..429e96b66ff6 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/VMMemory.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// VmMemory Data. + [System.ComponentModel.TypeConverter(typeof(VMMemoryTypeConverter))] + public partial class VMMemory + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IVMMemory DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new VMMemory(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.DataBoxEdge.Models.Api20220301.IVMMemory DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new VMMemory(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.DataBoxEdge.Models.Api20220301.IVMMemory FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal VMMemory(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartupMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMMemoryInternal)this).StartupMemoryMb = (long?) content.GetValueForProperty("StartupMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMMemoryInternal)this).StartupMemoryMb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CurrentMemoryUsageMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMMemoryInternal)this).CurrentMemoryUsageMb = (long?) content.GetValueForProperty("CurrentMemoryUsageMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMMemoryInternal)this).CurrentMemoryUsageMb, (__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 VMMemory(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartupMemoryMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMMemoryInternal)this).StartupMemoryMb = (long?) content.GetValueForProperty("StartupMemoryMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMMemoryInternal)this).StartupMemoryMb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CurrentMemoryUsageMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMMemoryInternal)this).CurrentMemoryUsageMb = (long?) content.GetValueForProperty("CurrentMemoryUsageMb",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMMemoryInternal)this).CurrentMemoryUsageMb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + } + /// VmMemory Data. + [System.ComponentModel.TypeConverter(typeof(VMMemoryTypeConverter))] + public partial interface IVMMemory + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/VMMemory.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/VMMemory.TypeConverter.cs new file mode 100644 index 000000000000..a082c90bfcbc --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/VMMemory.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class VMMemoryTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IVMMemory ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMMemory).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return VMMemory.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return VMMemory.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return VMMemory.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/databoxedge/generated/api/Models/Api20220301/VMMemory.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/VMMemory.cs new file mode 100644 index 000000000000..7936f2707472 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/VMMemory.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// VmMemory Data. + public partial class VMMemory : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMMemory, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMMemoryInternal + { + + /// Backing field for property. + private long? _currentMemoryUsageMb; + + /// The current memory used by the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public long? CurrentMemoryUsageMb { get => this._currentMemoryUsageMb; set => this._currentMemoryUsageMb = value; } + + /// Backing field for property. + private long? _startupMemoryMb; + + /// + /// The total amount of RAM in the virtual machine, as seen by the guest operating system. For a virtual machine with dynamic + /// memory enabled, this represents the initial memory available at startup. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public long? StartupMemoryMb { get => this._startupMemoryMb; set => this._startupMemoryMb = value; } + + /// Creates an new instance. + public VMMemory() + { + + } + } + /// VmMemory Data. + public partial interface IVMMemory : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The current memory used by the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The current memory used by the virtual machine.", + SerializedName = @"currentMemoryUsageMB", + PossibleTypes = new [] { typeof(long) })] + long? CurrentMemoryUsageMb { get; set; } + /// + /// The total amount of RAM in the virtual machine, as seen by the guest operating system. For a virtual machine with dynamic + /// memory enabled, this represents the initial memory available at startup. + /// + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total amount of RAM in the virtual machine, as seen by the guest operating system. For a virtual machine with dynamic memory enabled, this represents the initial memory available at startup.", + SerializedName = @"startupMemoryMB", + PossibleTypes = new [] { typeof(long) })] + long? StartupMemoryMb { get; set; } + + } + /// VmMemory Data. + internal partial interface IVMMemoryInternal + + { + /// The current memory used by the virtual machine. + long? CurrentMemoryUsageMb { get; set; } + /// + /// The total amount of RAM in the virtual machine, as seen by the guest operating system. For a virtual machine with dynamic + /// memory enabled, this represents the initial memory available at startup. + /// + long? StartupMemoryMb { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/VMMemory.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/VMMemory.json.cs new file mode 100644 index 000000000000..f30ffb7d1ac3 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/VMMemory.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// VmMemory Data. + public partial class VMMemory + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMMemory. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMMemory. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMMemory FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new VMMemory(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._startupMemoryMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((long)this._startupMemoryMb) : null, "startupMemoryMB" ,container.Add ); + AddIf( null != this._currentMemoryUsageMb ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNumber((long)this._currentMemoryUsageMb) : null, "currentMemoryUsageMB" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal VMMemory(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_startupMemoryMb = If( json?.PropertyT("startupMemoryMB"), out var __jsonStartupMemoryMb) ? (long?)__jsonStartupMemoryMb : StartupMemoryMb;} + {_currentMemoryUsageMb = If( json?.PropertyT("currentMemoryUsageMB"), out var __jsonCurrentMemoryUsageMb) ? (long?)__jsonCurrentMemoryUsageMb : CurrentMemoryUsageMb;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/VMPlacementRequestResult.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/VMPlacementRequestResult.PowerShell.cs new file mode 100644 index 000000000000..f8c014a9d4b5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/VMPlacementRequestResult.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// List of VM sizes being checked for creation on appliance along with corresponding result. + /// + [System.ComponentModel.TypeConverter(typeof(VMPlacementRequestResultTypeConverter))] + public partial class VMPlacementRequestResult + { + + /// + /// 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.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new VMPlacementRequestResult(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.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new VMPlacementRequestResult(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.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal VMPlacementRequestResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("VMSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResultInternal)this).VMSize = (string[]) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResultInternal)this).VMSize, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("IsFeasible")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResultInternal)this).IsFeasible = (bool?) content.GetValueForProperty("IsFeasible",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResultInternal)this).IsFeasible, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MessageCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResultInternal)this).MessageCode = (string) content.GetValueForProperty("MessageCode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResultInternal)this).MessageCode, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResultInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResultInternal)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 VMPlacementRequestResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("VMSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResultInternal)this).VMSize = (string[]) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResultInternal)this).VMSize, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("IsFeasible")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResultInternal)this).IsFeasible = (bool?) content.GetValueForProperty("IsFeasible",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResultInternal)this).IsFeasible, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MessageCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResultInternal)this).MessageCode = (string) content.GetValueForProperty("MessageCode",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResultInternal)this).MessageCode, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResultInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResultInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// List of VM sizes being checked for creation on appliance along with corresponding result. + [System.ComponentModel.TypeConverter(typeof(VMPlacementRequestResultTypeConverter))] + public partial interface IVMPlacementRequestResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/VMPlacementRequestResult.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/VMPlacementRequestResult.TypeConverter.cs new file mode 100644 index 000000000000..9709fc97a33f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/VMPlacementRequestResult.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.DataBoxEdge.Models.Api20220301 +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class VMPlacementRequestResultTypeConverter : 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 + /// 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(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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return VMPlacementRequestResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return VMPlacementRequestResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return VMPlacementRequestResult.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/databoxedge/generated/api/Models/Api20220301/VMPlacementRequestResult.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/VMPlacementRequestResult.cs new file mode 100644 index 000000000000..179c4cb9435c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/VMPlacementRequestResult.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// List of VM sizes being checked for creation on appliance along with corresponding result. + /// + public partial class VMPlacementRequestResult : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResultInternal + { + + /// Backing field for property. + private bool? _isFeasible; + + /// Boolean value indicating if the VM(s) in VmSize can be created. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public bool? IsFeasible { get => this._isFeasible; set => this._isFeasible = value; } + + /// Backing field for property. + private string _message; + + /// Localized message to be displayed to the user to explain the check result. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Backing field for property. + private string _messageCode; + + /// MessageCode indicating reason for success or failure. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string MessageCode { get => this._messageCode; set => this._messageCode = value; } + + /// Backing field for property. + private string[] _vMSize; + + /// List of VM sizes being checked. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string[] VMSize { get => this._vMSize; set => this._vMSize = value; } + + /// Creates an new instance. + public VMPlacementRequestResult() + { + + } + } + /// List of VM sizes being checked for creation on appliance along with corresponding result. + public partial interface IVMPlacementRequestResult : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// Boolean value indicating if the VM(s) in VmSize can be created. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Boolean value indicating if the VM(s) in VmSize can be created.", + SerializedName = @"isFeasible", + PossibleTypes = new [] { typeof(bool) })] + bool? IsFeasible { get; set; } + /// Localized message to be displayed to the user to explain the check result. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Localized message to be displayed to the user to explain the check result.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// MessageCode indicating reason for success or failure. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"MessageCode indicating reason for success or failure.", + SerializedName = @"messageCode", + PossibleTypes = new [] { typeof(string) })] + string MessageCode { get; set; } + /// List of VM sizes being checked. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of VM sizes being checked.", + SerializedName = @"vmSize", + PossibleTypes = new [] { typeof(string) })] + string[] VMSize { get; set; } + + } + /// List of VM sizes being checked for creation on appliance along with corresponding result. + internal partial interface IVMPlacementRequestResultInternal + + { + /// Boolean value indicating if the VM(s) in VmSize can be created. + bool? IsFeasible { get; set; } + /// Localized message to be displayed to the user to explain the check result. + string Message { get; set; } + /// MessageCode indicating reason for success or failure. + string MessageCode { get; set; } + /// List of VM sizes being checked. + string[] VMSize { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/Api20220301/VMPlacementRequestResult.json.cs b/swaggerci/databoxedge/generated/api/Models/Api20220301/VMPlacementRequestResult.json.cs new file mode 100644 index 000000000000..4e21a2a2d69c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/Api20220301/VMPlacementRequestResult.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.DataBoxEdge.Models.Api20220301 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + /// + /// List of VM sizes being checked for creation on appliance along with corresponding result. + /// + public partial class VMPlacementRequestResult + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new VMPlacementRequestResult(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._vMSize) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.XNodeArray(); + foreach( var __x in this._vMSize ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("vmSize",__w); + } + AddIf( null != this._isFeasible ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonBoolean((bool)this._isFeasible) : null, "isFeasible" ,container.Add ); + AddIf( null != (((object)this._messageCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._messageCode.ToString()) : null, "messageCode" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal VMPlacementRequestResult(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_vMSize = If( json?.PropertyT("vmSize"), out var __jsonVMSize) ? If( __jsonVMSize as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : VMSize;} + {_isFeasible = If( json?.PropertyT("isFeasible"), out var __jsonIsFeasible) ? (bool?)__jsonIsFeasible : IsFeasible;} + {_messageCode = If( json?.PropertyT("messageCode"), out var __jsonMessageCode) ? (string)__jsonMessageCode : (string)MessageCode;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/DataBoxEdgeIdentity.PowerShell.cs b/swaggerci/databoxedge/generated/api/Models/DataBoxEdgeIdentity.PowerShell.cs new file mode 100644 index 000000000000..d817fc2d20b5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/DataBoxEdgeIdentity.PowerShell.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.DataBoxEdge.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeIdentityTypeConverter))] + public partial class DataBoxEdgeIdentity + { + + /// + /// 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 DataBoxEdgeIdentity(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.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("DeviceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).DeviceName = (string) content.GetValueForProperty("DeviceName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).DeviceName, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("RoleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).RoleName = (string) content.GetValueForProperty("RoleName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).RoleName, global::System.Convert.ToString); + } + if (content.Contains("AddonName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).AddonName = (string) content.GetValueForProperty("AddonName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).AddonName, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).StorageAccountName = (string) content.GetValueForProperty("StorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).StorageAccountName, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)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 DataBoxEdgeIdentity(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.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("DeviceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).DeviceName = (string) content.GetValueForProperty("DeviceName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).DeviceName, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("RoleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).RoleName = (string) content.GetValueForProperty("RoleName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).RoleName, global::System.Convert.ToString); + } + if (content.Contains("AddonName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).AddonName = (string) content.GetValueForProperty("AddonName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).AddonName, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).StorageAccountName = (string) content.GetValueForProperty("StorageAccountName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).StorageAccountName, global::System.Convert.ToString); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal)this).Id, 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.DataBoxEdge.Models.IDataBoxEdgeIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DataBoxEdgeIdentity(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.DataBoxEdge.Models.IDataBoxEdgeIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DataBoxEdgeIdentity(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.DataBoxEdge.Models.IDataBoxEdgeIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(DataBoxEdgeIdentityTypeConverter))] + public partial interface IDataBoxEdgeIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/DataBoxEdgeIdentity.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Models/DataBoxEdgeIdentity.TypeConverter.cs new file mode 100644 index 000000000000..40ab3c532e7e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/DataBoxEdgeIdentity.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.DataBoxEdge.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DataBoxEdgeIdentityTypeConverter : 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 + /// 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(); + // 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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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.DataBoxEdge.Models.IDataBoxEdgeIdentity 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 DataBoxEdgeIdentity { Id = sourceValue }; + } + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DataBoxEdgeIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DataBoxEdgeIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DataBoxEdgeIdentity.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/databoxedge/generated/api/Models/DataBoxEdgeIdentity.cs b/swaggerci/databoxedge/generated/api/Models/DataBoxEdgeIdentity.cs new file mode 100644 index 000000000000..646dabf370de --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/DataBoxEdgeIdentity.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.DataBoxEdge.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + public partial class DataBoxEdgeIdentity : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentityInternal + { + + /// Backing field for property. + private string _addonName; + + /// The addon name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string AddonName { get => this._addonName; set => this._addonName = value; } + + /// Backing field for property. + private string _containerName; + + /// The container Name + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _id; + + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _name; + + /// The alert name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _roleName; + + /// The role name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string RoleName { get => this._roleName; set => this._roleName = value; } + + /// Backing field for property. + private string _storageAccountName; + + /// The storage account name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string StorageAccountName { get => this._storageAccountName; set => this._storageAccountName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Origin(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.PropertyOrigin.Owned)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Creates an new instance. + public DataBoxEdgeIdentity() + { + + } + } + public partial interface IDataBoxEdgeIdentity : + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IJsonSerializable + { + /// The addon name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The addon name.", + SerializedName = @"addonName", + PossibleTypes = new [] { typeof(string) })] + string AddonName { get; set; } + /// The container Name + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The container Name", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + string ContainerName { get; set; } + /// The device name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + string DeviceName { get; set; } + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource identity path", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// The alert name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The alert name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The resource group name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroupName { get; set; } + /// The role name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role name.", + SerializedName = @"roleName", + PossibleTypes = new [] { typeof(string) })] + string RoleName { get; set; } + /// The storage account name. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The storage account name.", + SerializedName = @"storageAccountName", + PossibleTypes = new [] { typeof(string) })] + string StorageAccountName { get; set; } + /// The subscription ID. + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + + } + internal partial interface IDataBoxEdgeIdentityInternal + + { + /// The addon name. + string AddonName { get; set; } + /// The container Name + string ContainerName { get; set; } + /// The device name. + string DeviceName { get; set; } + /// Resource identity path + string Id { get; set; } + /// The alert name. + string Name { get; set; } + /// The resource group name. + string ResourceGroupName { get; set; } + /// The role name. + string RoleName { get; set; } + /// The storage account name. + string StorageAccountName { get; set; } + /// The subscription ID. + string SubscriptionId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Models/DataBoxEdgeIdentity.json.cs b/swaggerci/databoxedge/generated/api/Models/DataBoxEdgeIdentity.json.cs new file mode 100644 index 000000000000..6006b606ceec --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Models/DataBoxEdgeIdentity.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.DataBoxEdge.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + + public partial class DataBoxEdgeIdentity + { + + /// + /// 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.DataBoxEdge.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject instance to deserialize from. + internal DataBoxEdgeIdentity(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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;} + {_deviceName = If( json?.PropertyT("deviceName"), out var __jsonDeviceName) ? (string)__jsonDeviceName : (string)DeviceName;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_roleName = If( json?.PropertyT("roleName"), out var __jsonRoleName) ? (string)__jsonRoleName : (string)RoleName;} + {_addonName = If( json?.PropertyT("addonName"), out var __jsonAddonName) ? (string)__jsonAddonName : (string)AddonName;} + {_storageAccountName = If( json?.PropertyT("storageAccountName"), out var __jsonStorageAccountName) ? (string)__jsonStorageAccountName : (string)StorageAccountName;} + {_containerName = If( json?.PropertyT("containerName"), out var __jsonContainerName) ? (string)__jsonContainerName : (string)ContainerName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject json ? new DataBoxEdgeIdentity(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.DataBoxEdge.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); + AddIf( null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName" ,container.Add ); + AddIf( null != (((object)this._deviceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._deviceName.ToString()) : null, "deviceName" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._roleName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._roleName.ToString()) : null, "roleName" ,container.Add ); + AddIf( null != (((object)this._addonName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._addonName.ToString()) : null, "addonName" ,container.Add ); + AddIf( null != (((object)this._storageAccountName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._storageAccountName.ToString()) : null, "storageAccountName" ,container.Add ); + AddIf( null != (((object)this._containerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonString(this._containerName.ToString()) : null, "containerName" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Support/AccessLevel.Completer.cs b/swaggerci/databoxedge/generated/api/Support/AccessLevel.Completer.cs new file mode 100644 index 000000000000..9a02d1cb2b63 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/AccessLevel.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.DataBoxEdge.Support +{ + + /// Access level allowed for this remote application type + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccessLevelTypeConverter))] + public partial struct AccessLevel : + 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) || "ReadOnly".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ReadOnly'", "ReadOnly", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReadOnly"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ReadWrite".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ReadWrite'", "ReadWrite", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReadWrite"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FullAccess".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FullAccess'", "FullAccess", global::System.Management.Automation.CompletionResultType.ParameterValue, "FullAccess"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/AccessLevel.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/AccessLevel.TypeConverter.cs new file mode 100644 index 000000000000..32b426cf033b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/AccessLevel.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.DataBoxEdge.Support +{ + + /// Access level allowed for this remote application type + public partial class AccessLevelTypeConverter : + 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) => AccessLevel.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/databoxedge/generated/api/Support/AccessLevel.cs b/swaggerci/databoxedge/generated/api/Support/AccessLevel.cs new file mode 100644 index 000000000000..e5c9e42dff41 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/AccessLevel.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.DataBoxEdge.Support +{ + + /// Access level allowed for this remote application type + public partial struct AccessLevel : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccessLevel FullAccess = @"FullAccess"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccessLevel None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccessLevel ReadOnly = @"ReadOnly"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccessLevel ReadWrite = @"ReadWrite"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private AccessLevel(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AccessLevel + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AccessLevel(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AccessLevel + /// 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.DataBoxEdge.Support.AccessLevel e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AccessLevel (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 AccessLevel && Equals((AccessLevel)obj); + } + + /// Returns hashCode for enum AccessLevel + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AccessLevel + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AccessLevel + /// the value to convert to an instance of . + + public static implicit operator AccessLevel(string value) + { + return new AccessLevel(value); + } + + /// Implicit operator to convert AccessLevel to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccessLevel e) + { + return e._value; + } + + /// Overriding != operator for enum AccessLevel + /// 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.DataBoxEdge.Support.AccessLevel e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccessLevel e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AccessLevel + /// 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.DataBoxEdge.Support.AccessLevel e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccessLevel e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/AccountType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/AccountType.Completer.cs new file mode 100644 index 000000000000..647a2c32e1c1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/AccountType.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.DataBoxEdge.Support +{ + + /// Type of storage accessed on the storage account. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountTypeTypeConverter))] + public partial struct AccountType : + 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) || "GeneralPurposeStorage".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'GeneralPurposeStorage'", "GeneralPurposeStorage", global::System.Management.Automation.CompletionResultType.ParameterValue, "GeneralPurposeStorage"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "BlobStorage".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'BlobStorage'", "BlobStorage", global::System.Management.Automation.CompletionResultType.ParameterValue, "BlobStorage"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/AccountType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/AccountType.TypeConverter.cs new file mode 100644 index 000000000000..1229743524b6 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/AccountType.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.DataBoxEdge.Support +{ + + /// Type of storage accessed on the storage account. + public partial class AccountTypeTypeConverter : + 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) => AccountType.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/databoxedge/generated/api/Support/AccountType.cs b/swaggerci/databoxedge/generated/api/Support/AccountType.cs new file mode 100644 index 000000000000..500fe9543842 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/AccountType.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.DataBoxEdge.Support +{ + + /// Type of storage accessed on the storage account. + public partial struct AccountType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType BlobStorage = @"BlobStorage"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType GeneralPurposeStorage = @"GeneralPurposeStorage"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private AccountType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AccountType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AccountType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AccountType + /// 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.DataBoxEdge.Support.AccountType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AccountType (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 AccountType && Equals((AccountType)obj); + } + + /// Returns hashCode for enum AccountType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AccountType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AccountType + /// the value to convert to an instance of . + + public static implicit operator AccountType(string value) + { + return new AccountType(value); + } + + /// Implicit operator to convert AccountType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType e) + { + return e._value; + } + + /// Overriding != operator for enum AccountType + /// 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.DataBoxEdge.Support.AccountType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AccountType + /// 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.DataBoxEdge.Support.AccountType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/AddonState.Completer.cs b/swaggerci/databoxedge/generated/api/Support/AddonState.Completer.cs new file mode 100644 index 000000000000..f8ed50c3dd2b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/AddonState.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.DataBoxEdge.Support +{ + + /// Addon Provisioning State + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonStateTypeConverter))] + public partial struct AddonState : + 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) || "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) || "Created".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Created'", "Created", global::System.Management.Automation.CompletionResultType.ParameterValue, "Created"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Reconfiguring".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Reconfiguring'", "Reconfiguring", global::System.Management.Automation.CompletionResultType.ParameterValue, "Reconfiguring"); + } + 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) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/AddonState.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/AddonState.TypeConverter.cs new file mode 100644 index 000000000000..580c67e880e3 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/AddonState.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.DataBoxEdge.Support +{ + + /// Addon Provisioning State + public partial class AddonStateTypeConverter : + 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) => AddonState.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/databoxedge/generated/api/Support/AddonState.cs b/swaggerci/databoxedge/generated/api/Support/AddonState.cs new file mode 100644 index 000000000000..25eb716c0290 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/AddonState.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.DataBoxEdge.Support +{ + + /// Addon Provisioning State + public partial struct AddonState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState Created = @"Created"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState Reconfiguring = @"Reconfiguring"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState Updating = @"Updating"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private AddonState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AddonState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AddonState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AddonState + /// 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.DataBoxEdge.Support.AddonState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AddonState (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 AddonState && Equals((AddonState)obj); + } + + /// Returns hashCode for enum AddonState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AddonState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AddonState + /// the value to convert to an instance of . + + public static implicit operator AddonState(string value) + { + return new AddonState(value); + } + + /// Implicit operator to convert AddonState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState e) + { + return e._value; + } + + /// Overriding != operator for enum AddonState + /// 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.DataBoxEdge.Support.AddonState e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AddonState + /// 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.DataBoxEdge.Support.AddonState e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/AddonType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/AddonType.Completer.cs new file mode 100644 index 000000000000..144bfd0aa529 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/AddonType.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.DataBoxEdge.Support +{ + + /// Addon type. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonTypeTypeConverter))] + public partial struct AddonType : + 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) || "IotEdge".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'IotEdge'", "IotEdge", global::System.Management.Automation.CompletionResultType.ParameterValue, "IotEdge"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ArcForKubernetes".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ArcForKubernetes'", "ArcForKubernetes", global::System.Management.Automation.CompletionResultType.ParameterValue, "ArcForKubernetes"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/AddonType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/AddonType.TypeConverter.cs new file mode 100644 index 000000000000..6cad99f83489 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/AddonType.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.DataBoxEdge.Support +{ + + /// Addon type. + public partial class AddonTypeTypeConverter : + 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) => AddonType.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/databoxedge/generated/api/Support/AddonType.cs b/swaggerci/databoxedge/generated/api/Support/AddonType.cs new file mode 100644 index 000000000000..da7c70f91f04 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/AddonType.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.DataBoxEdge.Support +{ + + /// Addon type. + public partial struct AddonType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType ArcForKubernetes = @"ArcForKubernetes"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType IotEdge = @"IotEdge"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private AddonType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AddonType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AddonType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AddonType + /// 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.DataBoxEdge.Support.AddonType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AddonType (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 AddonType && Equals((AddonType)obj); + } + + /// Returns hashCode for enum AddonType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AddonType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AddonType + /// the value to convert to an instance of . + + public static implicit operator AddonType(string value) + { + return new AddonType(value); + } + + /// Implicit operator to convert AddonType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType e) + { + return e._value; + } + + /// Overriding != operator for enum AddonType + /// 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.DataBoxEdge.Support.AddonType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AddonType + /// 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.DataBoxEdge.Support.AddonType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/AlertSeverity.Completer.cs b/swaggerci/databoxedge/generated/api/Support/AlertSeverity.Completer.cs new file mode 100644 index 000000000000..441a5913a108 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// Severity of the alert. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Support/AlertSeverity.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/AlertSeverity.TypeConverter.cs new file mode 100644 index 000000000000..999e6164e828 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/api/Support/AlertSeverity.cs b/swaggerci/databoxedge/generated/api/Support/AlertSeverity.cs new file mode 100644 index 000000000000..3c344f7d74d5 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// Severity of the alert. + public partial struct AlertSeverity : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity Critical = @"Critical"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity Informational = @"Informational"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity Warning = @"Warning"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Support.AlertSeverity e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Support.AlertSeverity e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AlertSeverity e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/AuthenticationType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/AuthenticationType.Completer.cs new file mode 100644 index 000000000000..e26f12668d9d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/AuthenticationType.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.DataBoxEdge.Support +{ + + /// The authentication type. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationTypeTypeConverter))] + public partial struct AuthenticationType : + 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) || "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/databoxedge/generated/api/Support/AuthenticationType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/AuthenticationType.TypeConverter.cs new file mode 100644 index 000000000000..e50eb434e2cb --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/AuthenticationType.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.DataBoxEdge.Support +{ + + /// The authentication type. + public partial class AuthenticationTypeTypeConverter : + 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) => AuthenticationType.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/databoxedge/generated/api/Support/AuthenticationType.cs b/swaggerci/databoxedge/generated/api/Support/AuthenticationType.cs new file mode 100644 index 000000000000..0f25decb82af --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/AuthenticationType.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.DataBoxEdge.Support +{ + + /// The authentication type. + public partial struct AuthenticationType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType AzureActiveDirectory = @"AzureActiveDirectory"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType Invalid = @"Invalid"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private AuthenticationType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AuthenticationType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AuthenticationType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AuthenticationType + /// 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.DataBoxEdge.Support.AuthenticationType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AuthenticationType (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 AuthenticationType && Equals((AuthenticationType)obj); + } + + /// Returns hashCode for enum AuthenticationType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AuthenticationType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AuthenticationType + /// the value to convert to an instance of . + + public static implicit operator AuthenticationType(string value) + { + return new AuthenticationType(value); + } + + /// Implicit operator to convert AuthenticationType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType e) + { + return e._value; + } + + /// Overriding != operator for enum AuthenticationType + /// 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.DataBoxEdge.Support.AuthenticationType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AuthenticationType + /// 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.DataBoxEdge.Support.AuthenticationType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/AzureContainerDataFormat.Completer.cs b/swaggerci/databoxedge/generated/api/Support/AzureContainerDataFormat.Completer.cs new file mode 100644 index 000000000000..e14960a73688 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/AzureContainerDataFormat.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.DataBoxEdge.Support +{ + + /// Storage format used for the file represented by the share. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormatTypeConverter))] + public partial struct AzureContainerDataFormat : + 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) || "BlockBlob".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'BlockBlob'", "BlockBlob", global::System.Management.Automation.CompletionResultType.ParameterValue, "BlockBlob"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PageBlob".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PageBlob'", "PageBlob", global::System.Management.Automation.CompletionResultType.ParameterValue, "PageBlob"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureFile".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureFile'", "AzureFile", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureFile"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/AzureContainerDataFormat.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/AzureContainerDataFormat.TypeConverter.cs new file mode 100644 index 000000000000..826811229780 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/AzureContainerDataFormat.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.DataBoxEdge.Support +{ + + /// Storage format used for the file represented by the share. + public partial class AzureContainerDataFormatTypeConverter : + 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) => AzureContainerDataFormat.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/databoxedge/generated/api/Support/AzureContainerDataFormat.cs b/swaggerci/databoxedge/generated/api/Support/AzureContainerDataFormat.cs new file mode 100644 index 000000000000..4ca6bd253b36 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/AzureContainerDataFormat.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.DataBoxEdge.Support +{ + + /// Storage format used for the file represented by the share. + public partial struct AzureContainerDataFormat : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat AzureFile = @"AzureFile"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat BlockBlob = @"BlockBlob"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat PageBlob = @"PageBlob"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private AzureContainerDataFormat(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AzureContainerDataFormat + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AzureContainerDataFormat(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AzureContainerDataFormat + /// 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.DataBoxEdge.Support.AzureContainerDataFormat e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AzureContainerDataFormat (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 AzureContainerDataFormat && Equals((AzureContainerDataFormat)obj); + } + + /// Returns hashCode for enum AzureContainerDataFormat + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AzureContainerDataFormat + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AzureContainerDataFormat + /// the value to convert to an instance of . + + public static implicit operator AzureContainerDataFormat(string value) + { + return new AzureContainerDataFormat(value); + } + + /// Implicit operator to convert AzureContainerDataFormat to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat e) + { + return e._value; + } + + /// Overriding != operator for enum AzureContainerDataFormat + /// 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.DataBoxEdge.Support.AzureContainerDataFormat e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AzureContainerDataFormat + /// 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.DataBoxEdge.Support.AzureContainerDataFormat e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/ClientPermissionType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/ClientPermissionType.Completer.cs new file mode 100644 index 000000000000..caecf54ee62c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ClientPermissionType.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.DataBoxEdge.Support +{ + + /// Type of access to be allowed for the client. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClientPermissionTypeTypeConverter))] + public partial struct ClientPermissionType : + 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) || "NoAccess".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NoAccess'", "NoAccess", global::System.Management.Automation.CompletionResultType.ParameterValue, "NoAccess"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ReadOnly".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ReadOnly'", "ReadOnly", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReadOnly"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ReadWrite".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ReadWrite'", "ReadWrite", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReadWrite"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/ClientPermissionType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/ClientPermissionType.TypeConverter.cs new file mode 100644 index 000000000000..74eb6be43607 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ClientPermissionType.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.DataBoxEdge.Support +{ + + /// Type of access to be allowed for the client. + public partial class ClientPermissionTypeTypeConverter : + 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) => ClientPermissionType.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/databoxedge/generated/api/Support/ClientPermissionType.cs b/swaggerci/databoxedge/generated/api/Support/ClientPermissionType.cs new file mode 100644 index 000000000000..edff430088d4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ClientPermissionType.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.DataBoxEdge.Support +{ + + /// Type of access to be allowed for the client. + public partial struct ClientPermissionType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClientPermissionType NoAccess = @"NoAccess"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClientPermissionType ReadOnly = @"ReadOnly"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClientPermissionType ReadWrite = @"ReadWrite"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private ClientPermissionType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ClientPermissionType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ClientPermissionType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ClientPermissionType + /// 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.DataBoxEdge.Support.ClientPermissionType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ClientPermissionType (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 ClientPermissionType && Equals((ClientPermissionType)obj); + } + + /// Returns hashCode for enum ClientPermissionType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ClientPermissionType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ClientPermissionType + /// the value to convert to an instance of . + + public static implicit operator ClientPermissionType(string value) + { + return new ClientPermissionType(value); + } + + /// Implicit operator to convert ClientPermissionType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClientPermissionType e) + { + return e._value; + } + + /// Overriding != operator for enum ClientPermissionType + /// 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.DataBoxEdge.Support.ClientPermissionType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClientPermissionType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ClientPermissionType + /// 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.DataBoxEdge.Support.ClientPermissionType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClientPermissionType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/ClusterWitnessType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/ClusterWitnessType.Completer.cs new file mode 100644 index 000000000000..bde845c342df --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ClusterWitnessType.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.DataBoxEdge.Support +{ + + /// Cluster Witness Type + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessTypeTypeConverter))] + public partial struct ClusterWitnessType : + 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) || "Cloud".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Cloud'", "Cloud", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cloud"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FileShare".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FileShare'", "FileShare", global::System.Management.Automation.CompletionResultType.ParameterValue, "FileShare"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/ClusterWitnessType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/ClusterWitnessType.TypeConverter.cs new file mode 100644 index 000000000000..f63e8785c503 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ClusterWitnessType.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.DataBoxEdge.Support +{ + + /// Cluster Witness Type + public partial class ClusterWitnessTypeTypeConverter : + 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) => ClusterWitnessType.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/databoxedge/generated/api/Support/ClusterWitnessType.cs b/swaggerci/databoxedge/generated/api/Support/ClusterWitnessType.cs new file mode 100644 index 000000000000..4bb1b1622ae7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ClusterWitnessType.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.DataBoxEdge.Support +{ + + /// Cluster Witness Type + public partial struct ClusterWitnessType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType Cloud = @"Cloud"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType FileShare = @"FileShare"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType None = @"None"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private ClusterWitnessType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ClusterWitnessType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ClusterWitnessType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ClusterWitnessType + /// 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.DataBoxEdge.Support.ClusterWitnessType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ClusterWitnessType (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 ClusterWitnessType && Equals((ClusterWitnessType)obj); + } + + /// Returns hashCode for enum ClusterWitnessType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ClusterWitnessType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ClusterWitnessType + /// the value to convert to an instance of . + + public static implicit operator ClusterWitnessType(string value) + { + return new ClusterWitnessType(value); + } + + /// Implicit operator to convert ClusterWitnessType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType e) + { + return e._value; + } + + /// Overriding != operator for enum ClusterWitnessType + /// 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.DataBoxEdge.Support.ClusterWitnessType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ClusterWitnessType + /// 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.DataBoxEdge.Support.ClusterWitnessType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ClusterWitnessType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/ContainerStatus.Completer.cs b/swaggerci/databoxedge/generated/api/Support/ContainerStatus.Completer.cs new file mode 100644 index 000000000000..64c47106121c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ContainerStatus.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.DataBoxEdge.Support +{ + + /// Current status of the container. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatusTypeConverter))] + public partial struct ContainerStatus : + 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) || "OK".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'OK'", "OK", global::System.Management.Automation.CompletionResultType.ParameterValue, "OK"); + } + 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) || "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) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NeedsAttention".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NeedsAttention'", "NeedsAttention", global::System.Management.Automation.CompletionResultType.ParameterValue, "NeedsAttention"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/ContainerStatus.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/ContainerStatus.TypeConverter.cs new file mode 100644 index 000000000000..61a754d215a5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ContainerStatus.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.DataBoxEdge.Support +{ + + /// Current status of the container. + public partial class ContainerStatusTypeConverter : + 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) => ContainerStatus.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/databoxedge/generated/api/Support/ContainerStatus.cs b/swaggerci/databoxedge/generated/api/Support/ContainerStatus.cs new file mode 100644 index 000000000000..50dfb0945cf5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ContainerStatus.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.DataBoxEdge.Support +{ + + /// Current status of the container. + public partial struct ContainerStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus NeedsAttention = @"NeedsAttention"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus Offline = @"Offline"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus Ok = @"OK"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus Unknown = @"Unknown"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus Updating = @"Updating"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the + /// the value to create an instance for. + private ContainerStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ContainerStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ContainerStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ContainerStatus + /// 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.DataBoxEdge.Support.ContainerStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ContainerStatus (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 ContainerStatus && Equals((ContainerStatus)obj); + } + + /// Returns hashCode for enum ContainerStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ContainerStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ContainerStatus + /// the value to convert to an instance of . + + public static implicit operator ContainerStatus(string value) + { + return new ContainerStatus(value); + } + + /// Implicit operator to convert ContainerStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus e) + { + return e._value; + } + + /// Overriding != operator for enum ContainerStatus + /// 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.DataBoxEdge.Support.ContainerStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ContainerStatus + /// 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.DataBoxEdge.Support.ContainerStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ContainerStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/CreatedByType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/CreatedByType.Completer.cs new file mode 100644 index 000000000000..2f3cab812319 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/CreatedByType.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.DataBoxEdge.Support +{ + + /// The type of identity that created the resource. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByTypeTypeConverter))] + public partial struct CreatedByType : + 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) || "User".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'User'", "User", global::System.Management.Automation.CompletionResultType.ParameterValue, "User"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Application".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Application'", "Application", global::System.Management.Automation.CompletionResultType.ParameterValue, "Application"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ManagedIdentity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ManagedIdentity'", "ManagedIdentity", global::System.Management.Automation.CompletionResultType.ParameterValue, "ManagedIdentity"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Key".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Key'", "Key", global::System.Management.Automation.CompletionResultType.ParameterValue, "Key"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/CreatedByType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/CreatedByType.TypeConverter.cs new file mode 100644 index 000000000000..b65ae61ec214 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/CreatedByType.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.DataBoxEdge.Support +{ + + /// The type of identity that created the resource. + public partial class CreatedByTypeTypeConverter : + 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) => CreatedByType.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/databoxedge/generated/api/Support/CreatedByType.cs b/swaggerci/databoxedge/generated/api/Support/CreatedByType.cs new file mode 100644 index 000000000000..d9950f15bf41 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/CreatedByType.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.DataBoxEdge.Support +{ + + /// The type of identity that created the resource. + public partial struct CreatedByType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType Application = @"Application"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType Key = @"Key"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType ManagedIdentity = @"ManagedIdentity"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType User = @"User"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to CreatedByType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new CreatedByType(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private CreatedByType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type CreatedByType + /// 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.DataBoxEdge.Support.CreatedByType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type CreatedByType (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 CreatedByType && Equals((CreatedByType)obj); + } + + /// Returns hashCode for enum CreatedByType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for CreatedByType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to CreatedByType + /// the value to convert to an instance of . + + public static implicit operator CreatedByType(string value) + { + return new CreatedByType(value); + } + + /// Implicit operator to convert CreatedByType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType e) + { + return e._value; + } + + /// Overriding != operator for enum CreatedByType + /// 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.DataBoxEdge.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum CreatedByType + /// 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.DataBoxEdge.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.CreatedByType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/DataBoxEdgeDeviceKind.Completer.cs b/swaggerci/databoxedge/generated/api/Support/DataBoxEdgeDeviceKind.Completer.cs new file mode 100644 index 000000000000..01ad0a3471af --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/DataBoxEdgeDeviceKind.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.DataBoxEdge.Support +{ + + /// The kind of the device. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceKindTypeConverter))] + public partial struct DataBoxEdgeDeviceKind : + 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) || "AzureDataBoxGateway".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureDataBoxGateway'", "AzureDataBoxGateway", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureDataBoxGateway"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureStackEdge".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureStackEdge'", "AzureStackEdge", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureStackEdge"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureStackHub".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureStackHub'", "AzureStackHub", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureStackHub"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureModularDataCentre".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureModularDataCentre'", "AzureModularDataCentre", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureModularDataCentre"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/DataBoxEdgeDeviceKind.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/DataBoxEdgeDeviceKind.TypeConverter.cs new file mode 100644 index 000000000000..cbf607d195fd --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/DataBoxEdgeDeviceKind.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.DataBoxEdge.Support +{ + + /// The kind of the device. + public partial class DataBoxEdgeDeviceKindTypeConverter : + 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) => DataBoxEdgeDeviceKind.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/databoxedge/generated/api/Support/DataBoxEdgeDeviceKind.cs b/swaggerci/databoxedge/generated/api/Support/DataBoxEdgeDeviceKind.cs new file mode 100644 index 000000000000..ee9ebe6c62e7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/DataBoxEdgeDeviceKind.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.DataBoxEdge.Support +{ + + /// The kind of the device. + public partial struct DataBoxEdgeDeviceKind : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceKind AzureDataBoxGateway = @"AzureDataBoxGateway"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceKind AzureModularDataCentre = @"AzureModularDataCentre"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceKind AzureStackEdge = @"AzureStackEdge"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceKind AzureStackHub = @"AzureStackHub"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DataBoxEdgeDeviceKind + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DataBoxEdgeDeviceKind(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private DataBoxEdgeDeviceKind(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DataBoxEdgeDeviceKind + /// 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.DataBoxEdge.Support.DataBoxEdgeDeviceKind e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DataBoxEdgeDeviceKind (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 DataBoxEdgeDeviceKind && Equals((DataBoxEdgeDeviceKind)obj); + } + + /// Returns hashCode for enum DataBoxEdgeDeviceKind + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DataBoxEdgeDeviceKind + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DataBoxEdgeDeviceKind + /// the value to convert to an instance of . + + public static implicit operator DataBoxEdgeDeviceKind(string value) + { + return new DataBoxEdgeDeviceKind(value); + } + + /// Implicit operator to convert DataBoxEdgeDeviceKind to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceKind e) + { + return e._value; + } + + /// Overriding != operator for enum DataBoxEdgeDeviceKind + /// 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.DataBoxEdge.Support.DataBoxEdgeDeviceKind e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceKind e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DataBoxEdgeDeviceKind + /// 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.DataBoxEdge.Support.DataBoxEdgeDeviceKind e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceKind e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/DataBoxEdgeDeviceStatus.Completer.cs b/swaggerci/databoxedge/generated/api/Support/DataBoxEdgeDeviceStatus.Completer.cs new file mode 100644 index 000000000000..87a1bbb651fc --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/DataBoxEdgeDeviceStatus.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.DataBoxEdge.Support +{ + + /// The status of the Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatusTypeConverter))] + public partial struct DataBoxEdgeDeviceStatus : + 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) || "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) || "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) || "NeedsAttention".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NeedsAttention'", "NeedsAttention", global::System.Management.Automation.CompletionResultType.ParameterValue, "NeedsAttention"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disconnected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Disconnected'", "Disconnected", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disconnected"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PartiallyDisconnected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PartiallyDisconnected'", "PartiallyDisconnected", global::System.Management.Automation.CompletionResultType.ParameterValue, "PartiallyDisconnected"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Maintenance".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Maintenance'", "Maintenance", global::System.Management.Automation.CompletionResultType.ParameterValue, "Maintenance"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/DataBoxEdgeDeviceStatus.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/DataBoxEdgeDeviceStatus.TypeConverter.cs new file mode 100644 index 000000000000..114a8d779350 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/DataBoxEdgeDeviceStatus.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.DataBoxEdge.Support +{ + + /// The status of the Data Box Edge/Gateway device. + public partial class DataBoxEdgeDeviceStatusTypeConverter : + 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) => DataBoxEdgeDeviceStatus.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/databoxedge/generated/api/Support/DataBoxEdgeDeviceStatus.cs b/swaggerci/databoxedge/generated/api/Support/DataBoxEdgeDeviceStatus.cs new file mode 100644 index 000000000000..a8cbb840b791 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/DataBoxEdgeDeviceStatus.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.DataBoxEdge.Support +{ + + /// The status of the Data Box Edge/Gateway device. + public partial struct DataBoxEdgeDeviceStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus Disconnected = @"Disconnected"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus Maintenance = @"Maintenance"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus NeedsAttention = @"NeedsAttention"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus Offline = @"Offline"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus Online = @"Online"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus PartiallyDisconnected = @"PartiallyDisconnected"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus ReadyToSetup = @"ReadyToSetup"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DataBoxEdgeDeviceStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DataBoxEdgeDeviceStatus(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private DataBoxEdgeDeviceStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DataBoxEdgeDeviceStatus + /// 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.DataBoxEdge.Support.DataBoxEdgeDeviceStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DataBoxEdgeDeviceStatus (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 DataBoxEdgeDeviceStatus && Equals((DataBoxEdgeDeviceStatus)obj); + } + + /// Returns hashCode for enum DataBoxEdgeDeviceStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DataBoxEdgeDeviceStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DataBoxEdgeDeviceStatus + /// the value to convert to an instance of . + + public static implicit operator DataBoxEdgeDeviceStatus(string value) + { + return new DataBoxEdgeDeviceStatus(value); + } + + /// Implicit operator to convert DataBoxEdgeDeviceStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus e) + { + return e._value; + } + + /// Overriding != operator for enum DataBoxEdgeDeviceStatus + /// 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.DataBoxEdge.Support.DataBoxEdgeDeviceStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DataBoxEdgeDeviceStatus + /// 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.DataBoxEdge.Support.DataBoxEdgeDeviceStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataBoxEdgeDeviceStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/DataPolicy.Completer.cs b/swaggerci/databoxedge/generated/api/Support/DataPolicy.Completer.cs new file mode 100644 index 000000000000..2ea3fa45d51d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/DataPolicy.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.DataBoxEdge.Support +{ + + /// Data policy of the share. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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) || "Cloud".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Cloud'", "Cloud", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cloud"); + } + 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"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/DataPolicy.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/DataPolicy.TypeConverter.cs new file mode 100644 index 000000000000..eba0588cd681 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// Data policy of the share. + 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/databoxedge/generated/api/Support/DataPolicy.cs b/swaggerci/databoxedge/generated/api/Support/DataPolicy.cs new file mode 100644 index 000000000000..cb4e2d1e88e9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/DataPolicy.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.DataBoxEdge.Support +{ + + /// Data policy of the share. + public partial struct DataPolicy : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy Cloud = @"Cloud"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy Local = @"Local"; + + /// 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 + /// 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Support.DataPolicy e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Support.DataPolicy e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/DataResidencyType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/DataResidencyType.Completer.cs new file mode 100644 index 000000000000..fd7328d2586d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/DataResidencyType.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.DataBoxEdge.Support +{ + + /// DataResidencyType enum + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyTypeTypeConverter))] + public partial struct DataResidencyType : + 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) || "GeoZoneReplication".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'GeoZoneReplication'", "GeoZoneReplication", global::System.Management.Automation.CompletionResultType.ParameterValue, "GeoZoneReplication"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ZoneReplication".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ZoneReplication'", "ZoneReplication", global::System.Management.Automation.CompletionResultType.ParameterValue, "ZoneReplication"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/DataResidencyType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/DataResidencyType.TypeConverter.cs new file mode 100644 index 000000000000..103c357934a8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/DataResidencyType.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.DataBoxEdge.Support +{ + + /// DataResidencyType enum + public partial class DataResidencyTypeTypeConverter : + 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) => DataResidencyType.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/databoxedge/generated/api/Support/DataResidencyType.cs b/swaggerci/databoxedge/generated/api/Support/DataResidencyType.cs new file mode 100644 index 000000000000..fda848cf1eb7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/DataResidencyType.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.DataBoxEdge.Support +{ + + /// DataResidencyType enum + public partial struct DataResidencyType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType GeoZoneReplication = @"GeoZoneReplication"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType ZoneReplication = @"ZoneReplication"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DataResidencyType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DataResidencyType(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private DataResidencyType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DataResidencyType + /// 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.DataBoxEdge.Support.DataResidencyType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DataResidencyType (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 DataResidencyType && Equals((DataResidencyType)obj); + } + + /// Returns hashCode for enum DataResidencyType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DataResidencyType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DataResidencyType + /// the value to convert to an instance of . + + public static implicit operator DataResidencyType(string value) + { + return new DataResidencyType(value); + } + + /// Implicit operator to convert DataResidencyType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType e) + { + return e._value; + } + + /// Overriding != operator for enum DataResidencyType + /// 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.DataBoxEdge.Support.DataResidencyType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DataResidencyType + /// 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.DataBoxEdge.Support.DataResidencyType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/DayOfWeek.Completer.cs b/swaggerci/databoxedge/generated/api/Support/DayOfWeek.Completer.cs new file mode 100644 index 000000000000..72ba6ae400c6 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/DayOfWeek.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.DataBoxEdge.Support +{ + + /// Argument completer implementation for DayOfWeek. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeekTypeConverter))] + public partial struct DayOfWeek : + 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) || "Sunday".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Sunday'", "Sunday", global::System.Management.Automation.CompletionResultType.ParameterValue, "Sunday"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Monday".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Monday'", "Monday", global::System.Management.Automation.CompletionResultType.ParameterValue, "Monday"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Tuesday".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Tuesday'", "Tuesday", global::System.Management.Automation.CompletionResultType.ParameterValue, "Tuesday"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Wednesday".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Wednesday'", "Wednesday", global::System.Management.Automation.CompletionResultType.ParameterValue, "Wednesday"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Thursday".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Thursday'", "Thursday", global::System.Management.Automation.CompletionResultType.ParameterValue, "Thursday"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Friday".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Friday'", "Friday", global::System.Management.Automation.CompletionResultType.ParameterValue, "Friday"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Saturday".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Saturday'", "Saturday", global::System.Management.Automation.CompletionResultType.ParameterValue, "Saturday"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/DayOfWeek.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/DayOfWeek.TypeConverter.cs new file mode 100644 index 000000000000..b08f4a15a767 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/DayOfWeek.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.DataBoxEdge.Support +{ + + /// TypeConverter implementation for DayOfWeek. + public partial class DayOfWeekTypeConverter : + 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) => DayOfWeek.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/databoxedge/generated/api/Support/DayOfWeek.cs b/swaggerci/databoxedge/generated/api/Support/DayOfWeek.cs new file mode 100644 index 000000000000..b0e80e27cd97 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/DayOfWeek.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.DataBoxEdge.Support +{ + + public partial struct DayOfWeek : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek Friday = @"Friday"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek Monday = @"Monday"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek Saturday = @"Saturday"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek Sunday = @"Sunday"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek Thursday = @"Thursday"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek Tuesday = @"Tuesday"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek Wednesday = @"Wednesday"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DayOfWeek + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DayOfWeek(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the + /// the value to create an instance for. + private DayOfWeek(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DayOfWeek + /// 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.DataBoxEdge.Support.DayOfWeek e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DayOfWeek (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 DayOfWeek && Equals((DayOfWeek)obj); + } + + /// Returns hashCode for enum DayOfWeek + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DayOfWeek + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DayOfWeek + /// the value to convert to an instance of . + + public static implicit operator DayOfWeek(string value) + { + return new DayOfWeek(value); + } + + /// Implicit operator to convert DayOfWeek to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek e) + { + return e._value; + } + + /// Overriding != operator for enum DayOfWeek + /// 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.DataBoxEdge.Support.DayOfWeek e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DayOfWeek + /// 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.DataBoxEdge.Support.DayOfWeek e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/DeviceType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/DeviceType.Completer.cs new file mode 100644 index 000000000000..43709330f87b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/DeviceType.Completer.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.DataBoxEdge.Support +{ + + /// The type of the Data Box Edge/Gateway device. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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) || "DataBoxEdgeDevice".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DataBoxEdgeDevice'", "DataBoxEdgeDevice", global::System.Management.Automation.CompletionResultType.ParameterValue, "DataBoxEdgeDevice"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/DeviceType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/DeviceType.TypeConverter.cs new file mode 100644 index 000000000000..4a6591d9ef33 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// The type of the Data Box Edge/Gateway 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/databoxedge/generated/api/Support/DeviceType.cs b/swaggerci/databoxedge/generated/api/Support/DeviceType.cs new file mode 100644 index 000000000000..1d67218427b8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/DeviceType.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.DataBoxEdge.Support +{ + + /// The type of the Data Box Edge/Gateway device. + public partial struct DeviceType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType DataBoxEdgeDevice = @"DataBoxEdgeDevice"; + + /// 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 + /// 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Support.DeviceType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Support.DeviceType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DeviceType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/DownloadPhase.Completer.cs b/swaggerci/databoxedge/generated/api/Support/DownloadPhase.Completer.cs new file mode 100644 index 000000000000..62f75b5f4b36 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// The download phase. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Support/DownloadPhase.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/DownloadPhase.TypeConverter.cs new file mode 100644 index 000000000000..5766034ed686 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/api/Support/DownloadPhase.cs b/swaggerci/databoxedge/generated/api/Support/DownloadPhase.cs new file mode 100644 index 000000000000..53dac606c14f --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// The download phase. + public partial struct DownloadPhase : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase Downloading = @"Downloading"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase Initializing = @"Initializing"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase Unknown = @"Unknown"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Support.DownloadPhase e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Support.DownloadPhase e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DownloadPhase e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/EncryptionAlgorithm.Completer.cs b/swaggerci/databoxedge/generated/api/Support/EncryptionAlgorithm.Completer.cs new file mode 100644 index 000000000000..a0213c67394a --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// The algorithm used to encrypt "Value". + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Support/EncryptionAlgorithm.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/EncryptionAlgorithm.TypeConverter.cs new file mode 100644 index 000000000000..556dc1cca130 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// The 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/databoxedge/generated/api/Support/EncryptionAlgorithm.cs b/swaggerci/databoxedge/generated/api/Support/EncryptionAlgorithm.cs new file mode 100644 index 000000000000..36d1ed562160 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// The algorithm used to encrypt "Value". + public partial struct EncryptionAlgorithm : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm Aes256 = @"AES256"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + /// 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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Support.EncryptionAlgorithm e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Support.EncryptionAlgorithm e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/HostPlatformType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/HostPlatformType.Completer.cs new file mode 100644 index 000000000000..449e3da37d06 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/HostPlatformType.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.DataBoxEdge.Support +{ + + /// Platform where the runtime is hosted. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformTypeTypeConverter))] + public partial struct HostPlatformType : + 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) || "KubernetesCluster".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'KubernetesCluster'", "KubernetesCluster", global::System.Management.Automation.CompletionResultType.ParameterValue, "KubernetesCluster"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "LinuxVM".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'LinuxVM'", "LinuxVM", global::System.Management.Automation.CompletionResultType.ParameterValue, "LinuxVM"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/HostPlatformType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/HostPlatformType.TypeConverter.cs new file mode 100644 index 000000000000..9c62baf47cbb --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/HostPlatformType.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.DataBoxEdge.Support +{ + + /// Platform where the runtime is hosted. + public partial class HostPlatformTypeTypeConverter : + 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) => HostPlatformType.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/databoxedge/generated/api/Support/HostPlatformType.cs b/swaggerci/databoxedge/generated/api/Support/HostPlatformType.cs new file mode 100644 index 000000000000..d60c97442e1d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/HostPlatformType.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.DataBoxEdge.Support +{ + + /// Platform where the runtime is hosted. + public partial struct HostPlatformType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType KubernetesCluster = @"KubernetesCluster"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType LinuxVM = @"LinuxVM"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to HostPlatformType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new HostPlatformType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type HostPlatformType + /// 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.DataBoxEdge.Support.HostPlatformType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type HostPlatformType (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 HostPlatformType && Equals((HostPlatformType)obj); + } + + /// Returns hashCode for enum HostPlatformType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private HostPlatformType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for HostPlatformType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to HostPlatformType + /// the value to convert to an instance of . + + public static implicit operator HostPlatformType(string value) + { + return new HostPlatformType(value); + } + + /// Implicit operator to convert HostPlatformType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType e) + { + return e._value; + } + + /// Overriding != operator for enum HostPlatformType + /// 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.DataBoxEdge.Support.HostPlatformType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum HostPlatformType + /// 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.DataBoxEdge.Support.HostPlatformType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.HostPlatformType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/InstallRebootBehavior.Completer.cs b/swaggerci/databoxedge/generated/api/Support/InstallRebootBehavior.Completer.cs new file mode 100644 index 000000000000..94b209ea1b21 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/InstallRebootBehavior.Completer.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support +{ + + /// + /// Indicates if updates are available and at least one of the updates needs a reboot. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehaviorTypeConverter))] + public partial struct InstallRebootBehavior : + 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) || "NeverReboots".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NeverReboots'", "NeverReboots", global::System.Management.Automation.CompletionResultType.ParameterValue, "NeverReboots"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RequiresReboot".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RequiresReboot'", "RequiresReboot", global::System.Management.Automation.CompletionResultType.ParameterValue, "RequiresReboot"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RequestReboot".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RequestReboot'", "RequestReboot", global::System.Management.Automation.CompletionResultType.ParameterValue, "RequestReboot"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/InstallRebootBehavior.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/InstallRebootBehavior.TypeConverter.cs new file mode 100644 index 000000000000..e7ce7ec6efac --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/InstallRebootBehavior.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.DataBoxEdge.Support +{ + + /// + /// Indicates if updates are available and at least one of the updates needs a reboot. + /// + public partial class InstallRebootBehaviorTypeConverter : + 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) => InstallRebootBehavior.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/databoxedge/generated/api/Support/InstallRebootBehavior.cs b/swaggerci/databoxedge/generated/api/Support/InstallRebootBehavior.cs new file mode 100644 index 000000000000..19bc0f209404 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/InstallRebootBehavior.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.DataBoxEdge.Support +{ + + /// + /// Indicates if updates are available and at least one of the updates needs a reboot. + /// + public partial struct InstallRebootBehavior : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior NeverReboots = @"NeverReboots"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior RequestReboot = @"RequestReboot"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior RequiresReboot = @"RequiresReboot"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to InstallRebootBehavior + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new InstallRebootBehavior(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type InstallRebootBehavior + /// 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.DataBoxEdge.Support.InstallRebootBehavior e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type InstallRebootBehavior (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 InstallRebootBehavior && Equals((InstallRebootBehavior)obj); + } + + /// Returns hashCode for enum InstallRebootBehavior + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private InstallRebootBehavior(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for InstallRebootBehavior + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to InstallRebootBehavior + /// the value to convert to an instance of . + + public static implicit operator InstallRebootBehavior(string value) + { + return new InstallRebootBehavior(value); + } + + /// Implicit operator to convert InstallRebootBehavior to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior e) + { + return e._value; + } + + /// Overriding != operator for enum InstallRebootBehavior + /// 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.DataBoxEdge.Support.InstallRebootBehavior e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum InstallRebootBehavior + /// 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.DataBoxEdge.Support.InstallRebootBehavior e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallRebootBehavior e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/InstallationImpact.Completer.cs b/swaggerci/databoxedge/generated/api/Support/InstallationImpact.Completer.cs new file mode 100644 index 000000000000..0676130b1343 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/InstallationImpact.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.DataBoxEdge.Support +{ + + /// Impact of Installing an updateType + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallationImpactTypeConverter))] + public partial struct InstallationImpact : + 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) || "DeviceRebooted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DeviceRebooted'", "DeviceRebooted", global::System.Management.Automation.CompletionResultType.ParameterValue, "DeviceRebooted"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "KubernetesWorkloadsDown".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'KubernetesWorkloadsDown'", "KubernetesWorkloadsDown", global::System.Management.Automation.CompletionResultType.ParameterValue, "KubernetesWorkloadsDown"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/InstallationImpact.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/InstallationImpact.TypeConverter.cs new file mode 100644 index 000000000000..e662b3d1d7c2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/InstallationImpact.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.DataBoxEdge.Support +{ + + /// Impact of Installing an updateType + public partial class InstallationImpactTypeConverter : + 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) => InstallationImpact.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/databoxedge/generated/api/Support/InstallationImpact.cs b/swaggerci/databoxedge/generated/api/Support/InstallationImpact.cs new file mode 100644 index 000000000000..473156a7fd5e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/InstallationImpact.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.DataBoxEdge.Support +{ + + /// Impact of Installing an updateType + public partial struct InstallationImpact : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallationImpact DeviceRebooted = @"DeviceRebooted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallationImpact KubernetesWorkloadsDown = @"KubernetesWorkloadsDown"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallationImpact None = @"None"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to InstallationImpact + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new InstallationImpact(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type InstallationImpact + /// 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.DataBoxEdge.Support.InstallationImpact e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type InstallationImpact (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 InstallationImpact && Equals((InstallationImpact)obj); + } + + /// Returns hashCode for enum InstallationImpact + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private InstallationImpact(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for InstallationImpact + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to InstallationImpact + /// the value to convert to an instance of . + + public static implicit operator InstallationImpact(string value) + { + return new InstallationImpact(value); + } + + /// Implicit operator to convert InstallationImpact to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallationImpact e) + { + return e._value; + } + + /// Overriding != operator for enum InstallationImpact + /// 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.DataBoxEdge.Support.InstallationImpact e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallationImpact e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum InstallationImpact + /// 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.DataBoxEdge.Support.InstallationImpact e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.InstallationImpact e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/JobStatus.Completer.cs b/swaggerci/databoxedge/generated/api/Support/JobStatus.Completer.cs new file mode 100644 index 000000000000..36c720193803 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// The current status of the job. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Support/JobStatus.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/JobStatus.TypeConverter.cs new file mode 100644 index 000000000000..38fde9c94e86 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// The 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/databoxedge/generated/api/Support/JobStatus.cs b/swaggerci/databoxedge/generated/api/Support/JobStatus.cs new file mode 100644 index 000000000000..86910900768a --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// The current status of the job. + public partial struct JobStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus Paused = @"Paused"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus Running = @"Running"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus Scheduled = @"Scheduled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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 + /// 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.DataBoxEdge.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.DataBoxEdge.Support.JobStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Support.JobStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/JobType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/JobType.Completer.cs new file mode 100644 index 000000000000..a2f4fe49e903 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/JobType.Completer.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support +{ + + /// The type of the job. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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) || "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) || "ScanForUpdates".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ScanForUpdates'", "ScanForUpdates", global::System.Management.Automation.CompletionResultType.ParameterValue, "ScanForUpdates"); + } + 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"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RefreshShare".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RefreshShare'", "RefreshShare", global::System.Management.Automation.CompletionResultType.ParameterValue, "RefreshShare"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RefreshContainer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RefreshContainer'", "RefreshContainer", global::System.Management.Automation.CompletionResultType.ParameterValue, "RefreshContainer"); + } + 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) || "Restore".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Restore'", "Restore", global::System.Management.Automation.CompletionResultType.ParameterValue, "Restore"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TriggerSupportPackage".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TriggerSupportPackage'", "TriggerSupportPackage", global::System.Management.Automation.CompletionResultType.ParameterValue, "TriggerSupportPackage"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/JobType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/JobType.TypeConverter.cs new file mode 100644 index 000000000000..a08c26c03f25 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// The type of the job. + 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/databoxedge/generated/api/Support/JobType.cs b/swaggerci/databoxedge/generated/api/Support/JobType.cs new file mode 100644 index 000000000000..5a9e22415f96 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/JobType.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.DataBoxEdge.Support +{ + + /// The type of the job. + public partial struct JobType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType Backup = @"Backup"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType DownloadUpdates = @"DownloadUpdates"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType InstallUpdates = @"InstallUpdates"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType RefreshContainer = @"RefreshContainer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType RefreshShare = @"RefreshShare"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType Restore = @"Restore"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType ScanForUpdates = @"ScanForUpdates"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType TriggerSupportPackage = @"TriggerSupportPackage"; + + /// 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.DataBoxEdge.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 + /// 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.DataBoxEdge.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.DataBoxEdge.Support.JobType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Support.JobType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.JobType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/KeyVaultSyncStatus.Completer.cs b/swaggerci/databoxedge/generated/api/Support/KeyVaultSyncStatus.Completer.cs new file mode 100644 index 000000000000..43bcbb622c87 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/KeyVaultSyncStatus.Completer.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support +{ + + /// + /// For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status will not + /// be applicable. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatusTypeConverter))] + public partial struct KeyVaultSyncStatus : + 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) || "KeyVaultSynced".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'KeyVaultSynced'", "KeyVaultSynced", global::System.Management.Automation.CompletionResultType.ParameterValue, "KeyVaultSynced"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "KeyVaultSyncFailed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'KeyVaultSyncFailed'", "KeyVaultSyncFailed", global::System.Management.Automation.CompletionResultType.ParameterValue, "KeyVaultSyncFailed"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "KeyVaultNotConfigured".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'KeyVaultNotConfigured'", "KeyVaultNotConfigured", global::System.Management.Automation.CompletionResultType.ParameterValue, "KeyVaultNotConfigured"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "KeyVaultSyncPending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'KeyVaultSyncPending'", "KeyVaultSyncPending", global::System.Management.Automation.CompletionResultType.ParameterValue, "KeyVaultSyncPending"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "KeyVaultSyncing".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'KeyVaultSyncing'", "KeyVaultSyncing", global::System.Management.Automation.CompletionResultType.ParameterValue, "KeyVaultSyncing"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "KeyVaultNotSynced".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'KeyVaultNotSynced'", "KeyVaultNotSynced", global::System.Management.Automation.CompletionResultType.ParameterValue, "KeyVaultNotSynced"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/KeyVaultSyncStatus.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/KeyVaultSyncStatus.TypeConverter.cs new file mode 100644 index 000000000000..b71aef9071aa --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/KeyVaultSyncStatus.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.DataBoxEdge.Support +{ + + /// + /// For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status will not + /// be applicable. + /// + public partial class KeyVaultSyncStatusTypeConverter : + 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) => KeyVaultSyncStatus.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/databoxedge/generated/api/Support/KeyVaultSyncStatus.cs b/swaggerci/databoxedge/generated/api/Support/KeyVaultSyncStatus.cs new file mode 100644 index 000000000000..0316b6512ac4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/KeyVaultSyncStatus.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.DataBoxEdge.Support +{ + + /// + /// For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status will not + /// be applicable. + /// + public partial struct KeyVaultSyncStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus KeyVaultNotConfigured = @"KeyVaultNotConfigured"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus KeyVaultNotSynced = @"KeyVaultNotSynced"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus KeyVaultSyncFailed = @"KeyVaultSyncFailed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus KeyVaultSyncPending = @"KeyVaultSyncPending"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus KeyVaultSynced = @"KeyVaultSynced"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus KeyVaultSyncing = @"KeyVaultSyncing"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to KeyVaultSyncStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new KeyVaultSyncStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type KeyVaultSyncStatus + /// 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.DataBoxEdge.Support.KeyVaultSyncStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type KeyVaultSyncStatus (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 KeyVaultSyncStatus && Equals((KeyVaultSyncStatus)obj); + } + + /// Returns hashCode for enum KeyVaultSyncStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private KeyVaultSyncStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for KeyVaultSyncStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to KeyVaultSyncStatus + /// the value to convert to an instance of . + + public static implicit operator KeyVaultSyncStatus(string value) + { + return new KeyVaultSyncStatus(value); + } + + /// Implicit operator to convert KeyVaultSyncStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus e) + { + return e._value; + } + + /// Overriding != operator for enum KeyVaultSyncStatus + /// 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.DataBoxEdge.Support.KeyVaultSyncStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum KeyVaultSyncStatus + /// 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.DataBoxEdge.Support.KeyVaultSyncStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/KubernetesNodeType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/KubernetesNodeType.Completer.cs new file mode 100644 index 000000000000..daf686dc2cb2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/KubernetesNodeType.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.DataBoxEdge.Support +{ + + /// Node type - Master/Worker + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesNodeTypeTypeConverter))] + public partial struct KubernetesNodeType : + 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) || "Master".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Master'", "Master", global::System.Management.Automation.CompletionResultType.ParameterValue, "Master"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Worker".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Worker'", "Worker", global::System.Management.Automation.CompletionResultType.ParameterValue, "Worker"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/KubernetesNodeType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/KubernetesNodeType.TypeConverter.cs new file mode 100644 index 000000000000..7a6807de78fa --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/KubernetesNodeType.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.DataBoxEdge.Support +{ + + /// Node type - Master/Worker + public partial class KubernetesNodeTypeTypeConverter : + 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) => KubernetesNodeType.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/databoxedge/generated/api/Support/KubernetesNodeType.cs b/swaggerci/databoxedge/generated/api/Support/KubernetesNodeType.cs new file mode 100644 index 000000000000..6b2edb776692 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/KubernetesNodeType.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.DataBoxEdge.Support +{ + + /// Node type - Master/Worker + public partial struct KubernetesNodeType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesNodeType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesNodeType Master = @"Master"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesNodeType Worker = @"Worker"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to KubernetesNodeType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new KubernetesNodeType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type KubernetesNodeType + /// 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.DataBoxEdge.Support.KubernetesNodeType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type KubernetesNodeType (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 KubernetesNodeType && Equals((KubernetesNodeType)obj); + } + + /// Returns hashCode for enum KubernetesNodeType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private KubernetesNodeType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for KubernetesNodeType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to KubernetesNodeType + /// the value to convert to an instance of . + + public static implicit operator KubernetesNodeType(string value) + { + return new KubernetesNodeType(value); + } + + /// Implicit operator to convert KubernetesNodeType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesNodeType e) + { + return e._value; + } + + /// Overriding != operator for enum KubernetesNodeType + /// 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.DataBoxEdge.Support.KubernetesNodeType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesNodeType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum KubernetesNodeType + /// 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.DataBoxEdge.Support.KubernetesNodeType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesNodeType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/KubernetesState.Completer.cs b/swaggerci/databoxedge/generated/api/Support/KubernetesState.Completer.cs new file mode 100644 index 000000000000..090f3434692f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/KubernetesState.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.DataBoxEdge.Support +{ + + /// State of Kubernetes deployment + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesStateTypeConverter))] + public partial struct KubernetesState : + 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) || "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) || "Created".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Created'", "Created", global::System.Management.Automation.CompletionResultType.ParameterValue, "Created"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Reconfiguring".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Reconfiguring'", "Reconfiguring", global::System.Management.Automation.CompletionResultType.ParameterValue, "Reconfiguring"); + } + 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) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/KubernetesState.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/KubernetesState.TypeConverter.cs new file mode 100644 index 000000000000..f04b072d98f0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/KubernetesState.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.DataBoxEdge.Support +{ + + /// State of Kubernetes deployment + public partial class KubernetesStateTypeConverter : + 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) => KubernetesState.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/databoxedge/generated/api/Support/KubernetesState.cs b/swaggerci/databoxedge/generated/api/Support/KubernetesState.cs new file mode 100644 index 000000000000..06aa4ad740b2 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/KubernetesState.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.DataBoxEdge.Support +{ + + /// State of Kubernetes deployment + public partial struct KubernetesState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState Created = @"Created"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState Reconfiguring = @"Reconfiguring"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState Updating = @"Updating"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to KubernetesState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new KubernetesState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type KubernetesState + /// 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.DataBoxEdge.Support.KubernetesState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type KubernetesState (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 KubernetesState && Equals((KubernetesState)obj); + } + + /// Returns hashCode for enum KubernetesState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private KubernetesState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for KubernetesState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to KubernetesState + /// the value to convert to an instance of . + + public static implicit operator KubernetesState(string value) + { + return new KubernetesState(value); + } + + /// Implicit operator to convert KubernetesState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState e) + { + return e._value; + } + + /// Overriding != operator for enum KubernetesState + /// 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.DataBoxEdge.Support.KubernetesState e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum KubernetesState + /// 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.DataBoxEdge.Support.KubernetesState e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KubernetesState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/MetricAggregationType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/MetricAggregationType.Completer.cs new file mode 100644 index 000000000000..215ccee5da84 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/MetricAggregationType.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.DataBoxEdge.Support +{ + + /// Metric aggregation type. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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) || "NotSpecified".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NotSpecified'", "NotSpecified", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotSpecified"); + } + 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) || "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) || "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) || "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) || "Total".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Total'", "Total", global::System.Management.Automation.CompletionResultType.ParameterValue, "Total"); + } + 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"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/MetricAggregationType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/MetricAggregationType.TypeConverter.cs new file mode 100644 index 000000000000..59753dff6123 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// 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/databoxedge/generated/api/Support/MetricAggregationType.cs b/swaggerci/databoxedge/generated/api/Support/MetricAggregationType.cs new file mode 100644 index 000000000000..d619ef16ca74 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/MetricAggregationType.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.DataBoxEdge.Support +{ + + /// Metric aggregation type. + public partial struct MetricAggregationType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType Average = @"Average"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType Count = @"Count"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType Maximum = @"Maximum"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType Minimum = @"Minimum"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType NotSpecified = @"NotSpecified"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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 + /// 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.DataBoxEdge.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.DataBoxEdge.Support.MetricAggregationType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Support.MetricAggregationType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricAggregationType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/MetricCategory.Completer.cs b/swaggerci/databoxedge/generated/api/Support/MetricCategory.Completer.cs new file mode 100644 index 000000000000..33fa62e68107 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/MetricCategory.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.DataBoxEdge.Support +{ + + /// Metric category. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricCategoryTypeConverter))] + public partial struct MetricCategory : + 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) || "Capacity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Capacity'", "Capacity", global::System.Management.Automation.CompletionResultType.ParameterValue, "Capacity"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Transaction".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Transaction'", "Transaction", global::System.Management.Automation.CompletionResultType.ParameterValue, "Transaction"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/MetricCategory.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/MetricCategory.TypeConverter.cs new file mode 100644 index 000000000000..bab28d49c774 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/MetricCategory.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.DataBoxEdge.Support +{ + + /// Metric category. + public partial class MetricCategoryTypeConverter : + 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) => MetricCategory.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/databoxedge/generated/api/Support/MetricCategory.cs b/swaggerci/databoxedge/generated/api/Support/MetricCategory.cs new file mode 100644 index 000000000000..71a0bd89c773 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/MetricCategory.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.DataBoxEdge.Support +{ + + /// Metric category. + public partial struct MetricCategory : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricCategory Capacity = @"Capacity"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricCategory Transaction = @"Transaction"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MetricCategory + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MetricCategory(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MetricCategory + /// 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.DataBoxEdge.Support.MetricCategory e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MetricCategory (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 MetricCategory && Equals((MetricCategory)obj); + } + + /// Returns hashCode for enum MetricCategory + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private MetricCategory(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MetricCategory + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MetricCategory + /// the value to convert to an instance of . + + public static implicit operator MetricCategory(string value) + { + return new MetricCategory(value); + } + + /// Implicit operator to convert MetricCategory to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricCategory e) + { + return e._value; + } + + /// Overriding != operator for enum MetricCategory + /// 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.DataBoxEdge.Support.MetricCategory e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricCategory e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MetricCategory + /// 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.DataBoxEdge.Support.MetricCategory e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricCategory e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/MetricUnit.Completer.cs b/swaggerci/databoxedge/generated/api/Support/MetricUnit.Completer.cs new file mode 100644 index 000000000000..bd9f41279efb --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/MetricUnit.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.DataBoxEdge.Support +{ + + /// Metric units. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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) || "NotSpecified".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NotSpecified'", "NotSpecified", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotSpecified"); + } + 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) || "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) || "Seconds".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Seconds'", "Seconds", global::System.Management.Automation.CompletionResultType.ParameterValue, "Seconds"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Milliseconds".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Milliseconds'", "Milliseconds", global::System.Management.Automation.CompletionResultType.ParameterValue, "Milliseconds"); + } + 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) || "CountPerSecond".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CountPerSecond'", "CountPerSecond", global::System.Management.Automation.CompletionResultType.ParameterValue, "CountPerSecond"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/MetricUnit.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/MetricUnit.TypeConverter.cs new file mode 100644 index 000000000000..b6c6b6f73ade --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// Metric units. + 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/databoxedge/generated/api/Support/MetricUnit.cs b/swaggerci/databoxedge/generated/api/Support/MetricUnit.cs new file mode 100644 index 000000000000..e44dad3cf3ff --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/MetricUnit.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.DataBoxEdge.Support +{ + + /// Metric units. + public partial struct MetricUnit : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricUnit Bytes = @"Bytes"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricUnit BytesPerSecond = @"BytesPerSecond"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricUnit Count = @"Count"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricUnit CountPerSecond = @"CountPerSecond"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricUnit Milliseconds = @"Milliseconds"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricUnit NotSpecified = @"NotSpecified"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricUnit Percent = @"Percent"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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 + /// 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.DataBoxEdge.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.DataBoxEdge.Support.MetricUnit e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Support.MetricUnit e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MetricUnit e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/MonitoringStatus.Completer.cs b/swaggerci/databoxedge/generated/api/Support/MonitoringStatus.Completer.cs new file mode 100644 index 000000000000..37b029c90030 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// Current monitoring status of the share. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Support/MonitoringStatus.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/MonitoringStatus.TypeConverter.cs new file mode 100644 index 000000000000..8d9f63ddd595 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// Current monitoring status of the share. + 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/databoxedge/generated/api/Support/MonitoringStatus.cs b/swaggerci/databoxedge/generated/api/Support/MonitoringStatus.cs new file mode 100644 index 000000000000..edea474a2140 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// Current monitoring status of the share. + public partial struct MonitoringStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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 + /// 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.DataBoxEdge.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.DataBoxEdge.Support.MonitoringStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Support.MonitoringStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/MountType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/MountType.Completer.cs new file mode 100644 index 000000000000..c17bd53148be --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/MountType.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.DataBoxEdge.Support +{ + + /// Mounting type. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MountTypeTypeConverter))] + public partial struct MountType : + 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) || "Volume".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Volume'", "Volume", global::System.Management.Automation.CompletionResultType.ParameterValue, "Volume"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "HostPath".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'HostPath'", "HostPath", global::System.Management.Automation.CompletionResultType.ParameterValue, "HostPath"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/MountType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/MountType.TypeConverter.cs new file mode 100644 index 000000000000..a46b9ee022c0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/MountType.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.DataBoxEdge.Support +{ + + /// Mounting type. + public partial class MountTypeTypeConverter : + 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) => MountType.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/databoxedge/generated/api/Support/MountType.cs b/swaggerci/databoxedge/generated/api/Support/MountType.cs new file mode 100644 index 000000000000..b4adb0ea5352 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/MountType.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.DataBoxEdge.Support +{ + + /// Mounting type. + public partial struct MountType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MountType HostPath = @"HostPath"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MountType Volume = @"Volume"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MountType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MountType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MountType + /// 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.DataBoxEdge.Support.MountType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MountType (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 MountType && Equals((MountType)obj); + } + + /// Returns hashCode for enum MountType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private MountType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MountType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MountType + /// the value to convert to an instance of . + + public static implicit operator MountType(string value) + { + return new MountType(value); + } + + /// Implicit operator to convert MountType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MountType e) + { + return e._value; + } + + /// Overriding != operator for enum MountType + /// 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.DataBoxEdge.Support.MountType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MountType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MountType + /// 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.DataBoxEdge.Support.MountType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MountType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/MsiIdentityType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/MsiIdentityType.Completer.cs new file mode 100644 index 000000000000..1a6cdd35e7dd --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/MsiIdentityType.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.DataBoxEdge.Support +{ + + /// Identity type + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityTypeTypeConverter))] + public partial struct MsiIdentityType : + 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) || "SystemAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SystemAssigned'", "SystemAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "SystemAssigned"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "UserAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'UserAssigned'", "UserAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "UserAssigned"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/MsiIdentityType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/MsiIdentityType.TypeConverter.cs new file mode 100644 index 000000000000..6c61075c987f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/MsiIdentityType.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.DataBoxEdge.Support +{ + + /// Identity type + public partial class MsiIdentityTypeTypeConverter : + 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) => MsiIdentityType.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/databoxedge/generated/api/Support/MsiIdentityType.cs b/swaggerci/databoxedge/generated/api/Support/MsiIdentityType.cs new file mode 100644 index 000000000000..eb69863de0e6 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/MsiIdentityType.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.DataBoxEdge.Support +{ + + /// Identity type + public partial struct MsiIdentityType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType SystemAssigned = @"SystemAssigned"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType UserAssigned = @"UserAssigned"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MsiIdentityType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MsiIdentityType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MsiIdentityType + /// 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.DataBoxEdge.Support.MsiIdentityType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MsiIdentityType (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 MsiIdentityType && Equals((MsiIdentityType)obj); + } + + /// Returns hashCode for enum MsiIdentityType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private MsiIdentityType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MsiIdentityType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MsiIdentityType + /// the value to convert to an instance of . + + public static implicit operator MsiIdentityType(string value) + { + return new MsiIdentityType(value); + } + + /// Implicit operator to convert MsiIdentityType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType e) + { + return e._value; + } + + /// Overriding != operator for enum MsiIdentityType + /// 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.DataBoxEdge.Support.MsiIdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MsiIdentityType + /// 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.DataBoxEdge.Support.MsiIdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/NetworkAdapterDhcpStatus.Completer.cs b/swaggerci/databoxedge/generated/api/Support/NetworkAdapterDhcpStatus.Completer.cs new file mode 100644 index 000000000000..e6ad97906f74 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/NetworkAdapterDhcpStatus.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.DataBoxEdge.Support +{ + + /// Value indicating whether this adapter has DHCP enabled. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterDhcpStatusTypeConverter))] + public partial struct NetworkAdapterDhcpStatus : + 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) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); + } + 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"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/NetworkAdapterDhcpStatus.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/NetworkAdapterDhcpStatus.TypeConverter.cs new file mode 100644 index 000000000000..916431c4d9be --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/NetworkAdapterDhcpStatus.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.DataBoxEdge.Support +{ + + /// Value indicating whether this adapter has DHCP enabled. + public partial class NetworkAdapterDhcpStatusTypeConverter : + 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) => NetworkAdapterDhcpStatus.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/databoxedge/generated/api/Support/NetworkAdapterDhcpStatus.cs b/swaggerci/databoxedge/generated/api/Support/NetworkAdapterDhcpStatus.cs new file mode 100644 index 000000000000..85ea81ca8155 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/NetworkAdapterDhcpStatus.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.DataBoxEdge.Support +{ + + /// Value indicating whether this adapter has DHCP enabled. + public partial struct NetworkAdapterDhcpStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterDhcpStatus Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterDhcpStatus Enabled = @"Enabled"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to NetworkAdapterDhcpStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new NetworkAdapterDhcpStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type NetworkAdapterDhcpStatus + /// 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.DataBoxEdge.Support.NetworkAdapterDhcpStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type NetworkAdapterDhcpStatus (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 NetworkAdapterDhcpStatus && Equals((NetworkAdapterDhcpStatus)obj); + } + + /// Returns hashCode for enum NetworkAdapterDhcpStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private NetworkAdapterDhcpStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for NetworkAdapterDhcpStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to NetworkAdapterDhcpStatus + /// the value to convert to an instance of . + + public static implicit operator NetworkAdapterDhcpStatus(string value) + { + return new NetworkAdapterDhcpStatus(value); + } + + /// Implicit operator to convert NetworkAdapterDhcpStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterDhcpStatus e) + { + return e._value; + } + + /// Overriding != operator for enum NetworkAdapterDhcpStatus + /// 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.DataBoxEdge.Support.NetworkAdapterDhcpStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterDhcpStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum NetworkAdapterDhcpStatus + /// 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.DataBoxEdge.Support.NetworkAdapterDhcpStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterDhcpStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/NetworkAdapterRdmaStatus.Completer.cs b/swaggerci/databoxedge/generated/api/Support/NetworkAdapterRdmaStatus.Completer.cs new file mode 100644 index 000000000000..8fdcd1471a0a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/NetworkAdapterRdmaStatus.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.DataBoxEdge.Support +{ + + /// Value indicating whether this adapter is RDMA capable. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterRdmaStatusTypeConverter))] + public partial struct NetworkAdapterRdmaStatus : + 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) || "Incapable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Incapable'", "Incapable", global::System.Management.Automation.CompletionResultType.ParameterValue, "Incapable"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Capable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Capable'", "Capable", global::System.Management.Automation.CompletionResultType.ParameterValue, "Capable"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/NetworkAdapterRdmaStatus.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/NetworkAdapterRdmaStatus.TypeConverter.cs new file mode 100644 index 000000000000..8d4a2ea8f026 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/NetworkAdapterRdmaStatus.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.DataBoxEdge.Support +{ + + /// Value indicating whether this adapter is RDMA capable. + public partial class NetworkAdapterRdmaStatusTypeConverter : + 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) => NetworkAdapterRdmaStatus.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/databoxedge/generated/api/Support/NetworkAdapterRdmaStatus.cs b/swaggerci/databoxedge/generated/api/Support/NetworkAdapterRdmaStatus.cs new file mode 100644 index 000000000000..197f57474683 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/NetworkAdapterRdmaStatus.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.DataBoxEdge.Support +{ + + /// Value indicating whether this adapter is RDMA capable. + public partial struct NetworkAdapterRdmaStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterRdmaStatus Capable = @"Capable"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterRdmaStatus Incapable = @"Incapable"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to NetworkAdapterRdmaStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new NetworkAdapterRdmaStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type NetworkAdapterRdmaStatus + /// 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.DataBoxEdge.Support.NetworkAdapterRdmaStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type NetworkAdapterRdmaStatus (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 NetworkAdapterRdmaStatus && Equals((NetworkAdapterRdmaStatus)obj); + } + + /// Returns hashCode for enum NetworkAdapterRdmaStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private NetworkAdapterRdmaStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for NetworkAdapterRdmaStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to NetworkAdapterRdmaStatus + /// the value to convert to an instance of . + + public static implicit operator NetworkAdapterRdmaStatus(string value) + { + return new NetworkAdapterRdmaStatus(value); + } + + /// Implicit operator to convert NetworkAdapterRdmaStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterRdmaStatus e) + { + return e._value; + } + + /// Overriding != operator for enum NetworkAdapterRdmaStatus + /// 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.DataBoxEdge.Support.NetworkAdapterRdmaStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterRdmaStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum NetworkAdapterRdmaStatus + /// 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.DataBoxEdge.Support.NetworkAdapterRdmaStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterRdmaStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/NetworkAdapterStatus.Completer.cs b/swaggerci/databoxedge/generated/api/Support/NetworkAdapterStatus.Completer.cs new file mode 100644 index 000000000000..7f9dfaaff1f1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/NetworkAdapterStatus.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.DataBoxEdge.Support +{ + + /// Value indicating whether this adapter is valid. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterStatusTypeConverter))] + public partial struct NetworkAdapterStatus : + 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) || "Inactive".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Inactive'", "Inactive", global::System.Management.Automation.CompletionResultType.ParameterValue, "Inactive"); + } + 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"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/NetworkAdapterStatus.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/NetworkAdapterStatus.TypeConverter.cs new file mode 100644 index 000000000000..498cc40457f9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/NetworkAdapterStatus.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.DataBoxEdge.Support +{ + + /// Value indicating whether this adapter is valid. + public partial class NetworkAdapterStatusTypeConverter : + 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) => NetworkAdapterStatus.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/databoxedge/generated/api/Support/NetworkAdapterStatus.cs b/swaggerci/databoxedge/generated/api/Support/NetworkAdapterStatus.cs new file mode 100644 index 000000000000..59e339765680 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/NetworkAdapterStatus.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.DataBoxEdge.Support +{ + + /// Value indicating whether this adapter is valid. + public partial struct NetworkAdapterStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterStatus Active = @"Active"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterStatus Inactive = @"Inactive"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to NetworkAdapterStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new NetworkAdapterStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type NetworkAdapterStatus + /// 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.DataBoxEdge.Support.NetworkAdapterStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type NetworkAdapterStatus (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 NetworkAdapterStatus && Equals((NetworkAdapterStatus)obj); + } + + /// Returns hashCode for enum NetworkAdapterStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private NetworkAdapterStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for NetworkAdapterStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to NetworkAdapterStatus + /// the value to convert to an instance of . + + public static implicit operator NetworkAdapterStatus(string value) + { + return new NetworkAdapterStatus(value); + } + + /// Implicit operator to convert NetworkAdapterStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterStatus e) + { + return e._value; + } + + /// Overriding != operator for enum NetworkAdapterStatus + /// 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.DataBoxEdge.Support.NetworkAdapterStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum NetworkAdapterStatus + /// 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.DataBoxEdge.Support.NetworkAdapterStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkAdapterStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/NetworkGroup.Completer.cs b/swaggerci/databoxedge/generated/api/Support/NetworkGroup.Completer.cs new file mode 100644 index 000000000000..25a1a3614184 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/NetworkGroup.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.DataBoxEdge.Support +{ + + /// The network group. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroupTypeConverter))] + public partial struct NetworkGroup : + 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) || "NonRDMA".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NonRDMA'", "NonRDMA", global::System.Management.Automation.CompletionResultType.ParameterValue, "NonRDMA"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RDMA".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RDMA'", "RDMA", global::System.Management.Automation.CompletionResultType.ParameterValue, "RDMA"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/NetworkGroup.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/NetworkGroup.TypeConverter.cs new file mode 100644 index 000000000000..006655e62d4b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/NetworkGroup.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.DataBoxEdge.Support +{ + + /// The network group. + public partial class NetworkGroupTypeConverter : + 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) => NetworkGroup.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/databoxedge/generated/api/Support/NetworkGroup.cs b/swaggerci/databoxedge/generated/api/Support/NetworkGroup.cs new file mode 100644 index 000000000000..3b3b62d49b68 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/NetworkGroup.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.DataBoxEdge.Support +{ + + /// The network group. + public partial struct NetworkGroup : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup NonRdma = @"NonRDMA"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup Rdma = @"RDMA"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to NetworkGroup + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new NetworkGroup(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type NetworkGroup + /// 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.DataBoxEdge.Support.NetworkGroup e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type NetworkGroup (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 NetworkGroup && Equals((NetworkGroup)obj); + } + + /// Returns hashCode for enum NetworkGroup + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private NetworkGroup(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for NetworkGroup + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to NetworkGroup + /// the value to convert to an instance of . + + public static implicit operator NetworkGroup(string value) + { + return new NetworkGroup(value); + } + + /// Implicit operator to convert NetworkGroup to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup e) + { + return e._value; + } + + /// Overriding != operator for enum NetworkGroup + /// 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.DataBoxEdge.Support.NetworkGroup e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum NetworkGroup + /// 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.DataBoxEdge.Support.NetworkGroup e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NetworkGroup e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/NodeStatus.Completer.cs b/swaggerci/databoxedge/generated/api/Support/NodeStatus.Completer.cs new file mode 100644 index 000000000000..11bbd8056361 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/NodeStatus.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.DataBoxEdge.Support +{ + + /// The current status of the individual node + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatusTypeConverter))] + public partial struct NodeStatus : + 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) || "Up".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Up'", "Up", global::System.Management.Automation.CompletionResultType.ParameterValue, "Up"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Down".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Down'", "Down", global::System.Management.Automation.CompletionResultType.ParameterValue, "Down"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Rebooting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Rebooting'", "Rebooting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Rebooting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ShuttingDown".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ShuttingDown'", "ShuttingDown", global::System.Management.Automation.CompletionResultType.ParameterValue, "ShuttingDown"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/NodeStatus.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/NodeStatus.TypeConverter.cs new file mode 100644 index 000000000000..d4f6bfeec6c0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/NodeStatus.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.DataBoxEdge.Support +{ + + /// The current status of the individual node + public partial class NodeStatusTypeConverter : + 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) => NodeStatus.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/databoxedge/generated/api/Support/NodeStatus.cs b/swaggerci/databoxedge/generated/api/Support/NodeStatus.cs new file mode 100644 index 000000000000..df3c4936508f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/NodeStatus.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.DataBoxEdge.Support +{ + + /// The current status of the individual node + public partial struct NodeStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus Down = @"Down"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus Rebooting = @"Rebooting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus ShuttingDown = @"ShuttingDown"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus Unknown = @"Unknown"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus Up = @"Up"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to NodeStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new NodeStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type NodeStatus + /// 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.DataBoxEdge.Support.NodeStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type NodeStatus (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 NodeStatus && Equals((NodeStatus)obj); + } + + /// Returns hashCode for enum NodeStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private NodeStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for NodeStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to NodeStatus + /// the value to convert to an instance of . + + public static implicit operator NodeStatus(string value) + { + return new NodeStatus(value); + } + + /// Implicit operator to convert NodeStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus e) + { + return e._value; + } + + /// Overriding != operator for enum NodeStatus + /// 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.DataBoxEdge.Support.NodeStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum NodeStatus + /// 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.DataBoxEdge.Support.NodeStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.NodeStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/OrderState.Completer.cs b/swaggerci/databoxedge/generated/api/Support/OrderState.Completer.cs new file mode 100644 index 000000000000..72ab16184fc7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/OrderState.Completer.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.DataBoxEdge.Support +{ + + /// Status of the order as per the allowed status types. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderStateTypeConverter))] + public partial struct OrderState : + 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) || "Untracked".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Untracked'", "Untracked", global::System.Management.Automation.CompletionResultType.ParameterValue, "Untracked"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AwaitingFulfillment".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AwaitingFulfillment'", "AwaitingFulfillment", global::System.Management.Automation.CompletionResultType.ParameterValue, "AwaitingFulfillment"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AwaitingPreparation".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AwaitingPreparation'", "AwaitingPreparation", global::System.Management.Automation.CompletionResultType.ParameterValue, "AwaitingPreparation"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AwaitingShipment".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AwaitingShipment'", "AwaitingShipment", global::System.Management.Automation.CompletionResultType.ParameterValue, "AwaitingShipment"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Shipped".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Shipped'", "Shipped", global::System.Management.Automation.CompletionResultType.ParameterValue, "Shipped"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Arriving".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Arriving'", "Arriving", global::System.Management.Automation.CompletionResultType.ParameterValue, "Arriving"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Delivered".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Delivered'", "Delivered", global::System.Management.Automation.CompletionResultType.ParameterValue, "Delivered"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ReplacementRequested".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ReplacementRequested'", "ReplacementRequested", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReplacementRequested"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "LostDevice".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'LostDevice'", "LostDevice", global::System.Management.Automation.CompletionResultType.ParameterValue, "LostDevice"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Declined".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Declined'", "Declined", global::System.Management.Automation.CompletionResultType.ParameterValue, "Declined"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ReturnInitiated".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ReturnInitiated'", "ReturnInitiated", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReturnInitiated"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AwaitingReturnShipment".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AwaitingReturnShipment'", "AwaitingReturnShipment", global::System.Management.Automation.CompletionResultType.ParameterValue, "AwaitingReturnShipment"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ShippedBack".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ShippedBack'", "ShippedBack", global::System.Management.Automation.CompletionResultType.ParameterValue, "ShippedBack"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CollectedAtMicrosoft".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CollectedAtMicrosoft'", "CollectedAtMicrosoft", global::System.Management.Automation.CompletionResultType.ParameterValue, "CollectedAtMicrosoft"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AwaitingPickup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AwaitingPickup'", "AwaitingPickup", global::System.Management.Automation.CompletionResultType.ParameterValue, "AwaitingPickup"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PickupCompleted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PickupCompleted'", "PickupCompleted", global::System.Management.Automation.CompletionResultType.ParameterValue, "PickupCompleted"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AwaitingDrop".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AwaitingDrop'", "AwaitingDrop", global::System.Management.Automation.CompletionResultType.ParameterValue, "AwaitingDrop"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/OrderState.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/OrderState.TypeConverter.cs new file mode 100644 index 000000000000..e9e1278899de --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/OrderState.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.DataBoxEdge.Support +{ + + /// Status of the order as per the allowed status types. + public partial class OrderStateTypeConverter : + 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) => OrderState.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/databoxedge/generated/api/Support/OrderState.cs b/swaggerci/databoxedge/generated/api/Support/OrderState.cs new file mode 100644 index 000000000000..c2cbbbd43b54 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/OrderState.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.DataBoxEdge.Support +{ + + /// Status of the order as per the allowed status types. + public partial struct OrderState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState Arriving = @"Arriving"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState AwaitingDrop = @"AwaitingDrop"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState AwaitingFulfillment = @"AwaitingFulfillment"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState AwaitingPickup = @"AwaitingPickup"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState AwaitingPreparation = @"AwaitingPreparation"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState AwaitingReturnShipment = @"AwaitingReturnShipment"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState AwaitingShipment = @"AwaitingShipment"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState CollectedAtMicrosoft = @"CollectedAtMicrosoft"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState Declined = @"Declined"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState Delivered = @"Delivered"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState LostDevice = @"LostDevice"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState PickupCompleted = @"PickupCompleted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState ReplacementRequested = @"ReplacementRequested"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState ReturnInitiated = @"ReturnInitiated"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState Shipped = @"Shipped"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState ShippedBack = @"ShippedBack"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState Untracked = @"Untracked"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to OrderState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new OrderState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type OrderState + /// 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.DataBoxEdge.Support.OrderState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type OrderState (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 OrderState && Equals((OrderState)obj); + } + + /// Returns hashCode for enum OrderState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private OrderState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for OrderState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to OrderState + /// the value to convert to an instance of . + + public static implicit operator OrderState(string value) + { + return new OrderState(value); + } + + /// Implicit operator to convert OrderState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState e) + { + return e._value; + } + + /// Overriding != operator for enum OrderState + /// 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.DataBoxEdge.Support.OrderState e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum OrderState + /// 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.DataBoxEdge.Support.OrderState e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.OrderState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/PlatformType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/PlatformType.Completer.cs new file mode 100644 index 000000000000..b610bb74c18f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/PlatformType.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.DataBoxEdge.Support +{ + + /// Host OS supported by the Arc addon. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformTypeTypeConverter))] + public partial struct PlatformType : + 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) || "Windows".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Windows'", "Windows", global::System.Management.Automation.CompletionResultType.ParameterValue, "Windows"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Linux".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Linux'", "Linux", global::System.Management.Automation.CompletionResultType.ParameterValue, "Linux"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/PlatformType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/PlatformType.TypeConverter.cs new file mode 100644 index 000000000000..481ee5823fbd --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/PlatformType.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.DataBoxEdge.Support +{ + + /// Host OS supported by the Arc addon. + public partial class PlatformTypeTypeConverter : + 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) => PlatformType.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/databoxedge/generated/api/Support/PlatformType.cs b/swaggerci/databoxedge/generated/api/Support/PlatformType.cs new file mode 100644 index 000000000000..d36f11437ae6 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/PlatformType.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.DataBoxEdge.Support +{ + + /// Host OS supported by the Arc addon. + public partial struct PlatformType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType Linux = @"Linux"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType Windows = @"Windows"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PlatformType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PlatformType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PlatformType + /// 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.DataBoxEdge.Support.PlatformType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PlatformType (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 PlatformType && Equals((PlatformType)obj); + } + + /// Returns hashCode for enum PlatformType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private PlatformType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PlatformType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PlatformType + /// the value to convert to an instance of . + + public static implicit operator PlatformType(string value) + { + return new PlatformType(value); + } + + /// Implicit operator to convert PlatformType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType e) + { + return e._value; + } + + /// Overriding != operator for enum PlatformType + /// 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.DataBoxEdge.Support.PlatformType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PlatformType + /// 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.DataBoxEdge.Support.PlatformType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PlatformType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/PosixComplianceStatus.Completer.cs b/swaggerci/databoxedge/generated/api/Support/PosixComplianceStatus.Completer.cs new file mode 100644 index 000000000000..e21657bf1ad7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/PosixComplianceStatus.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.DataBoxEdge.Support +{ + + /// If provisioned storage is posix compliant. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PosixComplianceStatusTypeConverter))] + public partial struct PosixComplianceStatus : + 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) || "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/databoxedge/generated/api/Support/PosixComplianceStatus.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/PosixComplianceStatus.TypeConverter.cs new file mode 100644 index 000000000000..ad469777c4f5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/PosixComplianceStatus.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.DataBoxEdge.Support +{ + + /// If provisioned storage is posix compliant. + public partial class PosixComplianceStatusTypeConverter : + 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) => PosixComplianceStatus.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/databoxedge/generated/api/Support/PosixComplianceStatus.cs b/swaggerci/databoxedge/generated/api/Support/PosixComplianceStatus.cs new file mode 100644 index 000000000000..19ad4cbf69f7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/PosixComplianceStatus.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.DataBoxEdge.Support +{ + + /// If provisioned storage is posix compliant. + public partial struct PosixComplianceStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PosixComplianceStatus Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PosixComplianceStatus Enabled = @"Enabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PosixComplianceStatus Invalid = @"Invalid"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PosixComplianceStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PosixComplianceStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PosixComplianceStatus + /// 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.DataBoxEdge.Support.PosixComplianceStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PosixComplianceStatus (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 PosixComplianceStatus && Equals((PosixComplianceStatus)obj); + } + + /// Returns hashCode for enum PosixComplianceStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private PosixComplianceStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PosixComplianceStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PosixComplianceStatus + /// the value to convert to an instance of . + + public static implicit operator PosixComplianceStatus(string value) + { + return new PosixComplianceStatus(value); + } + + /// Implicit operator to convert PosixComplianceStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PosixComplianceStatus e) + { + return e._value; + } + + /// Overriding != operator for enum PosixComplianceStatus + /// 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.DataBoxEdge.Support.PosixComplianceStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PosixComplianceStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PosixComplianceStatus + /// 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.DataBoxEdge.Support.PosixComplianceStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.PosixComplianceStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/ProactiveDiagnosticsConsent.Completer.cs b/swaggerci/databoxedge/generated/api/Support/ProactiveDiagnosticsConsent.Completer.cs new file mode 100644 index 000000000000..3c3bf047ff88 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ProactiveDiagnosticsConsent.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.DataBoxEdge.Support +{ + + /// Proactive diagnostic collection consent flag + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsentTypeConverter))] + public partial struct ProactiveDiagnosticsConsent : + 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/databoxedge/generated/api/Support/ProactiveDiagnosticsConsent.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/ProactiveDiagnosticsConsent.TypeConverter.cs new file mode 100644 index 000000000000..3c5a8b80e66e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ProactiveDiagnosticsConsent.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.DataBoxEdge.Support +{ + + /// Proactive diagnostic collection consent flag + public partial class ProactiveDiagnosticsConsentTypeConverter : + 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) => ProactiveDiagnosticsConsent.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/databoxedge/generated/api/Support/ProactiveDiagnosticsConsent.cs b/swaggerci/databoxedge/generated/api/Support/ProactiveDiagnosticsConsent.cs new file mode 100644 index 000000000000..8e87321c247c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ProactiveDiagnosticsConsent.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.DataBoxEdge.Support +{ + + /// Proactive diagnostic collection consent flag + public partial struct ProactiveDiagnosticsConsent : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent Enabled = @"Enabled"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to ProactiveDiagnosticsConsent + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ProactiveDiagnosticsConsent(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ProactiveDiagnosticsConsent + /// 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.DataBoxEdge.Support.ProactiveDiagnosticsConsent e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ProactiveDiagnosticsConsent (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 ProactiveDiagnosticsConsent && Equals((ProactiveDiagnosticsConsent)obj); + } + + /// Returns hashCode for enum ProactiveDiagnosticsConsent + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the + /// + /// the value to create an instance for. + private ProactiveDiagnosticsConsent(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ProactiveDiagnosticsConsent + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ProactiveDiagnosticsConsent + /// the value to convert to an instance of . + + public static implicit operator ProactiveDiagnosticsConsent(string value) + { + return new ProactiveDiagnosticsConsent(value); + } + + /// Implicit operator to convert ProactiveDiagnosticsConsent to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent e) + { + return e._value; + } + + /// Overriding != operator for enum ProactiveDiagnosticsConsent + /// 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.DataBoxEdge.Support.ProactiveDiagnosticsConsent e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ProactiveDiagnosticsConsent + /// 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.DataBoxEdge.Support.ProactiveDiagnosticsConsent e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ProactiveDiagnosticsConsent e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/RemoteApplicationType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/RemoteApplicationType.Completer.cs new file mode 100644 index 000000000000..42b8ecf5f247 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/RemoteApplicationType.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.DataBoxEdge.Support +{ + + /// Remote application type + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RemoteApplicationTypeTypeConverter))] + public partial struct RemoteApplicationType : + 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) || "Powershell".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Powershell'", "Powershell", global::System.Management.Automation.CompletionResultType.ParameterValue, "Powershell"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "WAC".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'WAC'", "WAC", global::System.Management.Automation.CompletionResultType.ParameterValue, "WAC"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "LocalUI".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'LocalUI'", "LocalUI", global::System.Management.Automation.CompletionResultType.ParameterValue, "LocalUI"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AllApplications".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AllApplications'", "AllApplications", global::System.Management.Automation.CompletionResultType.ParameterValue, "AllApplications"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/RemoteApplicationType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/RemoteApplicationType.TypeConverter.cs new file mode 100644 index 000000000000..84ed8e4e810a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/RemoteApplicationType.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.DataBoxEdge.Support +{ + + /// Remote application type + public partial class RemoteApplicationTypeTypeConverter : + 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) => RemoteApplicationType.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/databoxedge/generated/api/Support/RemoteApplicationType.cs b/swaggerci/databoxedge/generated/api/Support/RemoteApplicationType.cs new file mode 100644 index 000000000000..e3d0505130b4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/RemoteApplicationType.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.DataBoxEdge.Support +{ + + /// Remote application type + public partial struct RemoteApplicationType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RemoteApplicationType AllApplications = @"AllApplications"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RemoteApplicationType LocalUi = @"LocalUI"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RemoteApplicationType Powershell = @"Powershell"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RemoteApplicationType Wac = @"WAC"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to RemoteApplicationType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new RemoteApplicationType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type RemoteApplicationType + /// 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.DataBoxEdge.Support.RemoteApplicationType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type RemoteApplicationType (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 RemoteApplicationType && Equals((RemoteApplicationType)obj); + } + + /// Returns hashCode for enum RemoteApplicationType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private RemoteApplicationType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for RemoteApplicationType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to RemoteApplicationType + /// the value to convert to an instance of . + + public static implicit operator RemoteApplicationType(string value) + { + return new RemoteApplicationType(value); + } + + /// Implicit operator to convert RemoteApplicationType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RemoteApplicationType e) + { + return e._value; + } + + /// Overriding != operator for enum RemoteApplicationType + /// 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.DataBoxEdge.Support.RemoteApplicationType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RemoteApplicationType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum RemoteApplicationType + /// 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.DataBoxEdge.Support.RemoteApplicationType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RemoteApplicationType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/ResourceMoveStatus.Completer.cs b/swaggerci/databoxedge/generated/api/Support/ResourceMoveStatus.Completer.cs new file mode 100644 index 000000000000..fdbd314a3991 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ResourceMoveStatus.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.DataBoxEdge.Support +{ + + /// Denotes whether move operation is in progress + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatusTypeConverter))] + public partial struct ResourceMoveStatus : + 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) || "ResourceMoveInProgress".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ResourceMoveInProgress'", "ResourceMoveInProgress", global::System.Management.Automation.CompletionResultType.ParameterValue, "ResourceMoveInProgress"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ResourceMoveFailed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ResourceMoveFailed'", "ResourceMoveFailed", global::System.Management.Automation.CompletionResultType.ParameterValue, "ResourceMoveFailed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/ResourceMoveStatus.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/ResourceMoveStatus.TypeConverter.cs new file mode 100644 index 000000000000..acfc5adc3d2c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ResourceMoveStatus.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.DataBoxEdge.Support +{ + + /// Denotes whether move operation is in progress + public partial class ResourceMoveStatusTypeConverter : + 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) => ResourceMoveStatus.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/databoxedge/generated/api/Support/ResourceMoveStatus.cs b/swaggerci/databoxedge/generated/api/Support/ResourceMoveStatus.cs new file mode 100644 index 000000000000..0735f3ef7b23 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ResourceMoveStatus.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.DataBoxEdge.Support +{ + + /// Denotes whether move operation is in progress + public partial struct ResourceMoveStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus ResourceMoveFailed = @"ResourceMoveFailed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus ResourceMoveInProgress = @"ResourceMoveInProgress"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ResourceMoveStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ResourceMoveStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ResourceMoveStatus + /// 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.DataBoxEdge.Support.ResourceMoveStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ResourceMoveStatus (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 ResourceMoveStatus && Equals((ResourceMoveStatus)obj); + } + + /// Returns hashCode for enum ResourceMoveStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ResourceMoveStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ResourceMoveStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ResourceMoveStatus + /// the value to convert to an instance of . + + public static implicit operator ResourceMoveStatus(string value) + { + return new ResourceMoveStatus(value); + } + + /// Implicit operator to convert ResourceMoveStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus e) + { + return e._value; + } + + /// Overriding != operator for enum ResourceMoveStatus + /// 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.DataBoxEdge.Support.ResourceMoveStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ResourceMoveStatus + /// 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.DataBoxEdge.Support.ResourceMoveStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ResourceMoveStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/RoleStatus.Completer.cs b/swaggerci/databoxedge/generated/api/Support/RoleStatus.Completer.cs new file mode 100644 index 000000000000..f2dd51fec519 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/RoleStatus.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.DataBoxEdge.Support +{ + + /// Local Edge Management Status + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatusTypeConverter))] + public partial struct RoleStatus : + 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/databoxedge/generated/api/Support/RoleStatus.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/RoleStatus.TypeConverter.cs new file mode 100644 index 000000000000..78aa01a2213c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/RoleStatus.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.DataBoxEdge.Support +{ + + /// Local Edge Management Status + public partial class RoleStatusTypeConverter : + 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) => RoleStatus.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/databoxedge/generated/api/Support/RoleStatus.cs b/swaggerci/databoxedge/generated/api/Support/RoleStatus.cs new file mode 100644 index 000000000000..1431c3d9cf4b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/RoleStatus.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.DataBoxEdge.Support +{ + + /// Local Edge Management Status + public partial struct RoleStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus Enabled = @"Enabled"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to RoleStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new RoleStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type RoleStatus + /// 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.DataBoxEdge.Support.RoleStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type RoleStatus (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 RoleStatus && Equals((RoleStatus)obj); + } + + /// Returns hashCode for enum RoleStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private RoleStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for RoleStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to RoleStatus + /// the value to convert to an instance of . + + public static implicit operator RoleStatus(string value) + { + return new RoleStatus(value); + } + + /// Implicit operator to convert RoleStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus e) + { + return e._value; + } + + /// Overriding != operator for enum RoleStatus + /// 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.DataBoxEdge.Support.RoleStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum RoleStatus + /// 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.DataBoxEdge.Support.RoleStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/RoleTypes.Completer.cs b/swaggerci/databoxedge/generated/api/Support/RoleTypes.Completer.cs new file mode 100644 index 000000000000..2f847d8fb7b1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/RoleTypes.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.DataBoxEdge.Support +{ + + /// Argument completer implementation for RoleTypes. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypesTypeConverter))] + public partial struct RoleTypes : + 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) || "IOT".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'IOT'", "IOT", global::System.Management.Automation.CompletionResultType.ParameterValue, "IOT"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ASA".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ASA'", "ASA", global::System.Management.Automation.CompletionResultType.ParameterValue, "ASA"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Functions".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Functions'", "Functions", global::System.Management.Automation.CompletionResultType.ParameterValue, "Functions"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cognitive".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Cognitive'", "Cognitive", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cognitive"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MEC".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MEC'", "MEC", global::System.Management.Automation.CompletionResultType.ParameterValue, "MEC"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CloudEdgeManagement".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CloudEdgeManagement'", "CloudEdgeManagement", global::System.Management.Automation.CompletionResultType.ParameterValue, "CloudEdgeManagement"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Kubernetes".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Kubernetes'", "Kubernetes", global::System.Management.Automation.CompletionResultType.ParameterValue, "Kubernetes"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/RoleTypes.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/RoleTypes.TypeConverter.cs new file mode 100644 index 000000000000..39621a2a0fb5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/RoleTypes.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.DataBoxEdge.Support +{ + + /// TypeConverter implementation for RoleTypes. + public partial class RoleTypesTypeConverter : + 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) => RoleTypes.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/databoxedge/generated/api/Support/RoleTypes.cs b/swaggerci/databoxedge/generated/api/Support/RoleTypes.cs new file mode 100644 index 000000000000..dec7a053fbdd --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/RoleTypes.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.DataBoxEdge.Support +{ + + public partial struct RoleTypes : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes Asa = @"ASA"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes CloudEdgeManagement = @"CloudEdgeManagement"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes Cognitive = @"Cognitive"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes Functions = @"Functions"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes Iot = @"IOT"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes Kubernetes = @"Kubernetes"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes Mec = @"MEC"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to RoleTypes + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new RoleTypes(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type RoleTypes + /// 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.DataBoxEdge.Support.RoleTypes e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type RoleTypes (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 RoleTypes && Equals((RoleTypes)obj); + } + + /// Returns hashCode for enum RoleTypes + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private RoleTypes(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for RoleTypes + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to RoleTypes + /// the value to convert to an instance of . + + public static implicit operator RoleTypes(string value) + { + return new RoleTypes(value); + } + + /// Implicit operator to convert RoleTypes to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes e) + { + return e._value; + } + + /// Overriding != operator for enum RoleTypes + /// 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.DataBoxEdge.Support.RoleTypes e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum RoleTypes + /// 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.DataBoxEdge.Support.RoleTypes e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/ShareAccessProtocol.Completer.cs b/swaggerci/databoxedge/generated/api/Support/ShareAccessProtocol.Completer.cs new file mode 100644 index 000000000000..f6d5b4f24b49 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ShareAccessProtocol.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.DataBoxEdge.Support +{ + + /// Access protocol to be used by the share. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocolTypeConverter))] + public partial struct ShareAccessProtocol : + 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) || "SMB".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SMB'", "SMB", global::System.Management.Automation.CompletionResultType.ParameterValue, "SMB"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NFS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NFS'", "NFS", global::System.Management.Automation.CompletionResultType.ParameterValue, "NFS"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/ShareAccessProtocol.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/ShareAccessProtocol.TypeConverter.cs new file mode 100644 index 000000000000..fb1894df5bc4 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ShareAccessProtocol.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.DataBoxEdge.Support +{ + + /// Access protocol to be used by the share. + public partial class ShareAccessProtocolTypeConverter : + 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) => ShareAccessProtocol.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/databoxedge/generated/api/Support/ShareAccessProtocol.cs b/swaggerci/databoxedge/generated/api/Support/ShareAccessProtocol.cs new file mode 100644 index 000000000000..9c5e1ea90dc5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ShareAccessProtocol.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.DataBoxEdge.Support +{ + + /// Access protocol to be used by the share. + public partial struct ShareAccessProtocol : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol Nfs = @"NFS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol Smb = @"SMB"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ShareAccessProtocol + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ShareAccessProtocol(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ShareAccessProtocol + /// 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.DataBoxEdge.Support.ShareAccessProtocol e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ShareAccessProtocol (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 ShareAccessProtocol && Equals((ShareAccessProtocol)obj); + } + + /// Returns hashCode for enum ShareAccessProtocol + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ShareAccessProtocol(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ShareAccessProtocol + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ShareAccessProtocol + /// the value to convert to an instance of . + + public static implicit operator ShareAccessProtocol(string value) + { + return new ShareAccessProtocol(value); + } + + /// Implicit operator to convert ShareAccessProtocol to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol e) + { + return e._value; + } + + /// Overriding != operator for enum ShareAccessProtocol + /// 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.DataBoxEdge.Support.ShareAccessProtocol e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ShareAccessProtocol + /// 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.DataBoxEdge.Support.ShareAccessProtocol e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/ShareAccessType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/ShareAccessType.Completer.cs new file mode 100644 index 000000000000..35393789c1ee --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ShareAccessType.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.DataBoxEdge.Support +{ + + /// Type of access to be allowed on the share for this user. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessTypeTypeConverter))] + public partial struct ShareAccessType : + 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) || "Change".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Change'", "Change", global::System.Management.Automation.CompletionResultType.ParameterValue, "Change"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Read".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Read'", "Read", global::System.Management.Automation.CompletionResultType.ParameterValue, "Read"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Custom".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Custom'", "Custom", global::System.Management.Automation.CompletionResultType.ParameterValue, "Custom"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/ShareAccessType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/ShareAccessType.TypeConverter.cs new file mode 100644 index 000000000000..59143eee70d8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ShareAccessType.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.DataBoxEdge.Support +{ + + /// Type of access to be allowed on the share for this user. + public partial class ShareAccessTypeTypeConverter : + 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) => ShareAccessType.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/databoxedge/generated/api/Support/ShareAccessType.cs b/swaggerci/databoxedge/generated/api/Support/ShareAccessType.cs new file mode 100644 index 000000000000..6aa4247e100f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ShareAccessType.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.DataBoxEdge.Support +{ + + /// Type of access to be allowed on the share for this user. + public partial struct ShareAccessType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType Change = @"Change"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType Custom = @"Custom"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType Read = @"Read"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ShareAccessType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ShareAccessType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ShareAccessType + /// 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.DataBoxEdge.Support.ShareAccessType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ShareAccessType (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 ShareAccessType && Equals((ShareAccessType)obj); + } + + /// Returns hashCode for enum ShareAccessType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ShareAccessType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ShareAccessType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ShareAccessType + /// the value to convert to an instance of . + + public static implicit operator ShareAccessType(string value) + { + return new ShareAccessType(value); + } + + /// Implicit operator to convert ShareAccessType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType e) + { + return e._value; + } + + /// Overriding != operator for enum ShareAccessType + /// 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.DataBoxEdge.Support.ShareAccessType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ShareAccessType + /// 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.DataBoxEdge.Support.ShareAccessType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/ShareStatus.Completer.cs b/swaggerci/databoxedge/generated/api/Support/ShareStatus.Completer.cs new file mode 100644 index 000000000000..3f31101c00cd --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ShareStatus.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.DataBoxEdge.Support +{ + + /// Current status of the share. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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) || "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) || "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) || "OK".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'OK'", "OK", global::System.Management.Automation.CompletionResultType.ParameterValue, "OK"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NeedsAttention".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NeedsAttention'", "NeedsAttention", global::System.Management.Automation.CompletionResultType.ParameterValue, "NeedsAttention"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/ShareStatus.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/ShareStatus.TypeConverter.cs new file mode 100644 index 000000000000..8f8a415e6f06 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// Current status of the share. + 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/databoxedge/generated/api/Support/ShareStatus.cs b/swaggerci/databoxedge/generated/api/Support/ShareStatus.cs new file mode 100644 index 000000000000..e7f7663df52e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ShareStatus.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.DataBoxEdge.Support +{ + + /// Current status of the share. + public partial struct ShareStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus NeedsAttention = @"NeedsAttention"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus Offline = @"Offline"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus Ok = @"OK"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus Unknown = @"Unknown"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus Updating = @"Updating"; + + /// 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.DataBoxEdge.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 + /// 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.DataBoxEdge.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.DataBoxEdge.Support.ShareStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Support.ShareStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/ShipmentType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/ShipmentType.Completer.cs new file mode 100644 index 000000000000..ba49b4032263 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ShipmentType.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.DataBoxEdge.Support +{ + + /// Argument completer implementation for ShipmentType. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentTypeTypeConverter))] + public partial struct ShipmentType : + 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) || "NotApplicable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NotApplicable'", "NotApplicable", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotApplicable"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ShippedToCustomer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ShippedToCustomer'", "ShippedToCustomer", global::System.Management.Automation.CompletionResultType.ParameterValue, "ShippedToCustomer"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SelfPickup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SelfPickup'", "SelfPickup", global::System.Management.Automation.CompletionResultType.ParameterValue, "SelfPickup"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/ShipmentType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/ShipmentType.TypeConverter.cs new file mode 100644 index 000000000000..82baecf838bc --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ShipmentType.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.DataBoxEdge.Support +{ + + /// TypeConverter implementation for ShipmentType. + public partial class ShipmentTypeTypeConverter : + 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) => ShipmentType.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/databoxedge/generated/api/Support/ShipmentType.cs b/swaggerci/databoxedge/generated/api/Support/ShipmentType.cs new file mode 100644 index 000000000000..9b7c60cbee56 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/ShipmentType.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.DataBoxEdge.Support +{ + + public partial struct ShipmentType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType NotApplicable = @"NotApplicable"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType SelfPickup = @"SelfPickup"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType ShippedToCustomer = @"ShippedToCustomer"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ShipmentType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ShipmentType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ShipmentType + /// 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.DataBoxEdge.Support.ShipmentType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ShipmentType (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 ShipmentType && Equals((ShipmentType)obj); + } + + /// Returns hashCode for enum ShipmentType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private ShipmentType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ShipmentType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ShipmentType + /// the value to convert to an instance of . + + public static implicit operator ShipmentType(string value) + { + return new ShipmentType(value); + } + + /// Implicit operator to convert ShipmentType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType e) + { + return e._value; + } + + /// Overriding != operator for enum ShipmentType + /// 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.DataBoxEdge.Support.ShipmentType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ShipmentType + /// 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.DataBoxEdge.Support.ShipmentType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/SkuAvailability.Completer.cs b/swaggerci/databoxedge/generated/api/Support/SkuAvailability.Completer.cs new file mode 100644 index 000000000000..85d53e95c5fb --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/SkuAvailability.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.DataBoxEdge.Support +{ + + /// Links to the next set of results + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuAvailabilityTypeConverter))] + public partial struct SkuAvailability : + 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) || "Available".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Available'", "Available", global::System.Management.Automation.CompletionResultType.ParameterValue, "Available"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unavailable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Unavailable'", "Unavailable", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unavailable"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/SkuAvailability.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/SkuAvailability.TypeConverter.cs new file mode 100644 index 000000000000..f49dce4a29ae --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/SkuAvailability.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.DataBoxEdge.Support +{ + + /// Links to the next set of results + public partial class SkuAvailabilityTypeConverter : + 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) => SkuAvailability.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/databoxedge/generated/api/Support/SkuAvailability.cs b/swaggerci/databoxedge/generated/api/Support/SkuAvailability.cs new file mode 100644 index 000000000000..8b700c533726 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/SkuAvailability.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.DataBoxEdge.Support +{ + + /// Links to the next set of results + public partial struct SkuAvailability : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuAvailability Available = @"Available"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuAvailability Unavailable = @"Unavailable"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SkuAvailability + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SkuAvailability(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SkuAvailability + /// 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.DataBoxEdge.Support.SkuAvailability e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SkuAvailability (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 SkuAvailability && Equals((SkuAvailability)obj); + } + + /// Returns hashCode for enum SkuAvailability + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private SkuAvailability(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SkuAvailability + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SkuAvailability + /// the value to convert to an instance of . + + public static implicit operator SkuAvailability(string value) + { + return new SkuAvailability(value); + } + + /// Implicit operator to convert SkuAvailability to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuAvailability e) + { + return e._value; + } + + /// Overriding != operator for enum SkuAvailability + /// 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.DataBoxEdge.Support.SkuAvailability e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuAvailability e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SkuAvailability + /// 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.DataBoxEdge.Support.SkuAvailability e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuAvailability e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/SkuName.Completer.cs b/swaggerci/databoxedge/generated/api/Support/SkuName.Completer.cs new file mode 100644 index 000000000000..611ac8ac76da --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/SkuName.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.DataBoxEdge.Support +{ + + /// The Sku name. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuNameTypeConverter))] + public partial struct SkuName : + 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) || "Gateway".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Gateway'", "Gateway", global::System.Management.Automation.CompletionResultType.ParameterValue, "Gateway"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Edge".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Edge'", "Edge", global::System.Management.Automation.CompletionResultType.ParameterValue, "Edge"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TEA_1Node".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TEA_1Node'", "TEA_1Node", global::System.Management.Automation.CompletionResultType.ParameterValue, "TEA_1Node"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TEA_1Node_UPS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TEA_1Node_UPS'", "TEA_1Node_UPS", global::System.Management.Automation.CompletionResultType.ParameterValue, "TEA_1Node_UPS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TEA_1Node_Heater".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TEA_1Node_Heater'", "TEA_1Node_Heater", global::System.Management.Automation.CompletionResultType.ParameterValue, "TEA_1Node_Heater"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TEA_1Node_UPS_Heater".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TEA_1Node_UPS_Heater'", "TEA_1Node_UPS_Heater", global::System.Management.Automation.CompletionResultType.ParameterValue, "TEA_1Node_UPS_Heater"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TEA_4Node_Heater".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TEA_4Node_Heater'", "TEA_4Node_Heater", global::System.Management.Automation.CompletionResultType.ParameterValue, "TEA_4Node_Heater"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TEA_4Node_UPS_Heater".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TEA_4Node_UPS_Heater'", "TEA_4Node_UPS_Heater", global::System.Management.Automation.CompletionResultType.ParameterValue, "TEA_4Node_UPS_Heater"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TMA".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TMA'", "TMA", global::System.Management.Automation.CompletionResultType.ParameterValue, "TMA"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TDC".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TDC'", "TDC", global::System.Management.Automation.CompletionResultType.ParameterValue, "TDC"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TCA_Small".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TCA_Small'", "TCA_Small", global::System.Management.Automation.CompletionResultType.ParameterValue, "TCA_Small"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "GPU".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'GPU'", "GPU", global::System.Management.Automation.CompletionResultType.ParameterValue, "GPU"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TCA_Large".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TCA_Large'", "TCA_Large", global::System.Management.Automation.CompletionResultType.ParameterValue, "TCA_Large"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "EdgeP_Base".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EdgeP_Base'", "EdgeP_Base", global::System.Management.Automation.CompletionResultType.ParameterValue, "EdgeP_Base"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "EdgeP_High".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EdgeP_High'", "EdgeP_High", global::System.Management.Automation.CompletionResultType.ParameterValue, "EdgeP_High"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "EdgePR_Base".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EdgePR_Base'", "EdgePR_Base", global::System.Management.Automation.CompletionResultType.ParameterValue, "EdgePR_Base"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "EdgePR_Base_UPS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EdgePR_Base_UPS'", "EdgePR_Base_UPS", global::System.Management.Automation.CompletionResultType.ParameterValue, "EdgePR_Base_UPS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "EP2_64_1VPU_W".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EP2_64_1VPU_W'", "EP2_64_1VPU_W", global::System.Management.Automation.CompletionResultType.ParameterValue, "EP2_64_1VPU_W"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "EP2_128_1T4_Mx1_W".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EP2_128_1T4_Mx1_W'", "EP2_128_1T4_Mx1_W", global::System.Management.Automation.CompletionResultType.ParameterValue, "EP2_128_1T4_Mx1_W"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "EP2_256_2T4_W".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EP2_256_2T4_W'", "EP2_256_2T4_W", global::System.Management.Automation.CompletionResultType.ParameterValue, "EP2_256_2T4_W"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "EdgeMR_Mini".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EdgeMR_Mini'", "EdgeMR_Mini", global::System.Management.Automation.CompletionResultType.ParameterValue, "EdgeMR_Mini"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RCA_Small".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RCA_Small'", "RCA_Small", global::System.Management.Automation.CompletionResultType.ParameterValue, "RCA_Small"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RCA_Large".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RCA_Large'", "RCA_Large", global::System.Management.Automation.CompletionResultType.ParameterValue, "RCA_Large"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RDC".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RDC'", "RDC", global::System.Management.Automation.CompletionResultType.ParameterValue, "RDC"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Management".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Management'", "Management", global::System.Management.Automation.CompletionResultType.ParameterValue, "Management"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "EP2_64_Mx1_W".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EP2_64_Mx1_W'", "EP2_64_Mx1_W", global::System.Management.Automation.CompletionResultType.ParameterValue, "EP2_64_Mx1_W"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "EP2_128_GPU1_Mx1_W".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EP2_128_GPU1_Mx1_W'", "EP2_128_GPU1_Mx1_W", global::System.Management.Automation.CompletionResultType.ParameterValue, "EP2_128_GPU1_Mx1_W"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "EP2_256_GPU2_Mx1".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EP2_256_GPU2_Mx1'", "EP2_256_GPU2_Mx1", global::System.Management.Automation.CompletionResultType.ParameterValue, "EP2_256_GPU2_Mx1"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "EdgeMR_TCP".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EdgeMR_TCP'", "EdgeMR_TCP", global::System.Management.Automation.CompletionResultType.ParameterValue, "EdgeMR_TCP"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/SkuName.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/SkuName.TypeConverter.cs new file mode 100644 index 000000000000..03ad483f10ac --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/SkuName.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.DataBoxEdge.Support +{ + + /// The Sku name. + public partial class SkuNameTypeConverter : + 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) => SkuName.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/databoxedge/generated/api/Support/SkuName.cs b/swaggerci/databoxedge/generated/api/Support/SkuName.cs new file mode 100644 index 000000000000..91873ad87838 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/SkuName.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.DataBoxEdge.Support +{ + + /// The Sku name. + public partial struct SkuName : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName Edge = @"Edge"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName EdgeMrMini = @"EdgeMR_Mini"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName EdgeMrTcp = @"EdgeMR_TCP"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName EdgePBase = @"EdgeP_Base"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName EdgePHigh = @"EdgeP_High"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName EdgePrBase = @"EdgePR_Base"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName EdgePrBaseUps = @"EdgePR_Base_UPS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName Ep21281T4Mx1W = @"EP2_128_1T4_Mx1_W"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName Ep2128Gpu1Mx1W = @"EP2_128_GPU1_Mx1_W"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName Ep22562T4W = @"EP2_256_2T4_W"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName Ep2256Gpu2Mx1 = @"EP2_256_GPU2_Mx1"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName Ep2641VpuW = @"EP2_64_1VPU_W"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName Ep264Mx1W = @"EP2_64_Mx1_W"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName Gateway = @"Gateway"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName Gpu = @"GPU"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName Management = @"Management"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName RcaLarge = @"RCA_Large"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName RcaSmall = @"RCA_Small"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName Rdc = @"RDC"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName TcaLarge = @"TCA_Large"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName TcaSmall = @"TCA_Small"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName Tdc = @"TDC"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName Tea1Node = @"TEA_1Node"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName Tea1NodeHeater = @"TEA_1Node_Heater"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName Tea1NodeUps = @"TEA_1Node_UPS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName Tea1NodeUpsHeater = @"TEA_1Node_UPS_Heater"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName Tea4NodeHeater = @"TEA_4Node_Heater"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName Tea4NodeUpsHeater = @"TEA_4Node_UPS_Heater"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName Tma = @"TMA"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SkuName + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SkuName(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SkuName + /// 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.DataBoxEdge.Support.SkuName e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SkuName (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 SkuName && Equals((SkuName)obj); + } + + /// Returns hashCode for enum SkuName + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private SkuName(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SkuName + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SkuName + /// the value to convert to an instance of . + + public static implicit operator SkuName(string value) + { + return new SkuName(value); + } + + /// Implicit operator to convert SkuName to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName e) + { + return e._value; + } + + /// Overriding != operator for enum SkuName + /// 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.DataBoxEdge.Support.SkuName e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SkuName + /// 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.DataBoxEdge.Support.SkuName e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/SkuSignupOption.Completer.cs b/swaggerci/databoxedge/generated/api/Support/SkuSignupOption.Completer.cs new file mode 100644 index 000000000000..790ce2cd5954 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/SkuSignupOption.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.DataBoxEdge.Support +{ + + /// Sku can be signed up by customer or not. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuSignupOptionTypeConverter))] + public partial struct SkuSignupOption : + 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) || "Available".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Available'", "Available", global::System.Management.Automation.CompletionResultType.ParameterValue, "Available"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/SkuSignupOption.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/SkuSignupOption.TypeConverter.cs new file mode 100644 index 000000000000..e67d99f9608a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/SkuSignupOption.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.DataBoxEdge.Support +{ + + /// Sku can be signed up by customer or not. + public partial class SkuSignupOptionTypeConverter : + 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) => SkuSignupOption.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/databoxedge/generated/api/Support/SkuSignupOption.cs b/swaggerci/databoxedge/generated/api/Support/SkuSignupOption.cs new file mode 100644 index 000000000000..936a0c03cc7a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/SkuSignupOption.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.DataBoxEdge.Support +{ + + /// Sku can be signed up by customer or not. + public partial struct SkuSignupOption : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuSignupOption Available = @"Available"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuSignupOption None = @"None"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SkuSignupOption + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SkuSignupOption(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SkuSignupOption + /// 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.DataBoxEdge.Support.SkuSignupOption e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SkuSignupOption (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 SkuSignupOption && Equals((SkuSignupOption)obj); + } + + /// Returns hashCode for enum SkuSignupOption + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private SkuSignupOption(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SkuSignupOption + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SkuSignupOption + /// the value to convert to an instance of . + + public static implicit operator SkuSignupOption(string value) + { + return new SkuSignupOption(value); + } + + /// Implicit operator to convert SkuSignupOption to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuSignupOption e) + { + return e._value; + } + + /// Overriding != operator for enum SkuSignupOption + /// 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.DataBoxEdge.Support.SkuSignupOption e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuSignupOption e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SkuSignupOption + /// 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.DataBoxEdge.Support.SkuSignupOption e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuSignupOption e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/SkuTier.Completer.cs b/swaggerci/databoxedge/generated/api/Support/SkuTier.Completer.cs new file mode 100644 index 000000000000..0456e14ad2ac --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/SkuTier.Completer.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.DataBoxEdge.Support +{ + + /// The Sku tier. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTierTypeConverter))] + public partial struct SkuTier : + 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) || "Standard".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Standard'", "Standard", global::System.Management.Automation.CompletionResultType.ParameterValue, "Standard"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/SkuTier.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/SkuTier.TypeConverter.cs new file mode 100644 index 000000000000..186092a9ec80 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/SkuTier.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.DataBoxEdge.Support +{ + + /// The Sku tier. + public partial class SkuTierTypeConverter : + 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) => SkuTier.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/databoxedge/generated/api/Support/SkuTier.cs b/swaggerci/databoxedge/generated/api/Support/SkuTier.cs new file mode 100644 index 000000000000..f88d36dc16c0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/SkuTier.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.DataBoxEdge.Support +{ + + /// The Sku tier. + public partial struct SkuTier : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier Standard = @"Standard"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SkuTier + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SkuTier(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SkuTier + /// 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.DataBoxEdge.Support.SkuTier e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SkuTier (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 SkuTier && Equals((SkuTier)obj); + } + + /// Returns hashCode for enum SkuTier + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private SkuTier(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SkuTier + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SkuTier + /// the value to convert to an instance of . + + public static implicit operator SkuTier(string value) + { + return new SkuTier(value); + } + + /// Implicit operator to convert SkuTier to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier e) + { + return e._value; + } + + /// Overriding != operator for enum SkuTier + /// 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.DataBoxEdge.Support.SkuTier e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SkuTier + /// 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.DataBoxEdge.Support.SkuTier e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/SkuVersion.Completer.cs b/swaggerci/databoxedge/generated/api/Support/SkuVersion.Completer.cs new file mode 100644 index 000000000000..c197fad8de3e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/SkuVersion.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.DataBoxEdge.Support +{ + + /// Availability of the Sku as preview/stable. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuVersionTypeConverter))] + public partial struct SkuVersion : + 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) || "Stable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Stable'", "Stable", global::System.Management.Automation.CompletionResultType.ParameterValue, "Stable"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Preview".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Preview'", "Preview", global::System.Management.Automation.CompletionResultType.ParameterValue, "Preview"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/SkuVersion.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/SkuVersion.TypeConverter.cs new file mode 100644 index 000000000000..ec93d72a5ab0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/SkuVersion.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.DataBoxEdge.Support +{ + + /// Availability of the Sku as preview/stable. + public partial class SkuVersionTypeConverter : + 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) => SkuVersion.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/databoxedge/generated/api/Support/SkuVersion.cs b/swaggerci/databoxedge/generated/api/Support/SkuVersion.cs new file mode 100644 index 000000000000..b4037b5e1bf8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/SkuVersion.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.DataBoxEdge.Support +{ + + /// Availability of the Sku as preview/stable. + public partial struct SkuVersion : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuVersion Preview = @"Preview"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuVersion Stable = @"Stable"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SkuVersion + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SkuVersion(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SkuVersion + /// 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.DataBoxEdge.Support.SkuVersion e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SkuVersion (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 SkuVersion && Equals((SkuVersion)obj); + } + + /// Returns hashCode for enum SkuVersion + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private SkuVersion(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SkuVersion + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SkuVersion + /// the value to convert to an instance of . + + public static implicit operator SkuVersion(string value) + { + return new SkuVersion(value); + } + + /// Implicit operator to convert SkuVersion to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuVersion e) + { + return e._value; + } + + /// Overriding != operator for enum SkuVersion + /// 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.DataBoxEdge.Support.SkuVersion e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuVersion e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SkuVersion + /// 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.DataBoxEdge.Support.SkuVersion e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuVersion e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/SslStatus.Completer.cs b/swaggerci/databoxedge/generated/api/Support/SslStatus.Completer.cs new file mode 100644 index 000000000000..f6b32654adf2 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// Signifies whether SSL needs to be enabled or not. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/api/Support/SslStatus.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/SslStatus.TypeConverter.cs new file mode 100644 index 000000000000..319a4addd806 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// Signifies whether 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/databoxedge/generated/api/Support/SslStatus.cs b/swaggerci/databoxedge/generated/api/Support/SslStatus.cs new file mode 100644 index 000000000000..0330bf715a70 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// Signifies whether SSL needs to be enabled or not. + public partial struct SslStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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 + /// 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.DataBoxEdge.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.DataBoxEdge.Support.SslStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Support.SslStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/StorageAccountStatus.Completer.cs b/swaggerci/databoxedge/generated/api/Support/StorageAccountStatus.Completer.cs new file mode 100644 index 000000000000..4092010caee9 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/StorageAccountStatus.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.DataBoxEdge.Support +{ + + /// Current status of the storage account + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatusTypeConverter))] + public partial struct StorageAccountStatus : + 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) || "OK".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'OK'", "OK", global::System.Management.Automation.CompletionResultType.ParameterValue, "OK"); + } + 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) || "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) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NeedsAttention".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NeedsAttention'", "NeedsAttention", global::System.Management.Automation.CompletionResultType.ParameterValue, "NeedsAttention"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/StorageAccountStatus.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/StorageAccountStatus.TypeConverter.cs new file mode 100644 index 000000000000..1b0f52251d4a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/StorageAccountStatus.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.DataBoxEdge.Support +{ + + /// Current status of the storage account + public partial class StorageAccountStatusTypeConverter : + 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) => StorageAccountStatus.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/databoxedge/generated/api/Support/StorageAccountStatus.cs b/swaggerci/databoxedge/generated/api/Support/StorageAccountStatus.cs new file mode 100644 index 000000000000..7140b725af6e --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/StorageAccountStatus.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.DataBoxEdge.Support +{ + + /// Current status of the storage account + public partial struct StorageAccountStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus NeedsAttention = @"NeedsAttention"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus Offline = @"Offline"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus Ok = @"OK"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus Unknown = @"Unknown"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus Updating = @"Updating"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to StorageAccountStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new StorageAccountStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type StorageAccountStatus + /// 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.DataBoxEdge.Support.StorageAccountStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type StorageAccountStatus (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 StorageAccountStatus && Equals((StorageAccountStatus)obj); + } + + /// Returns hashCode for enum StorageAccountStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private StorageAccountStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for StorageAccountStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to StorageAccountStatus + /// the value to convert to an instance of . + + public static implicit operator StorageAccountStatus(string value) + { + return new StorageAccountStatus(value); + } + + /// Implicit operator to convert StorageAccountStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus e) + { + return e._value; + } + + /// Overriding != operator for enum StorageAccountStatus + /// 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.DataBoxEdge.Support.StorageAccountStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum StorageAccountStatus + /// 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.DataBoxEdge.Support.StorageAccountStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/SubscriptionState.Completer.cs b/swaggerci/databoxedge/generated/api/Support/SubscriptionState.Completer.cs new file mode 100644 index 000000000000..ace5af73936a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/SubscriptionState.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.DataBoxEdge.Support +{ + + /// Argument completer implementation for SubscriptionState. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionStateTypeConverter))] + public partial struct SubscriptionState : + 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) || "Registered".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Registered'", "Registered", global::System.Management.Automation.CompletionResultType.ParameterValue, "Registered"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Warned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Warned'", "Warned", global::System.Management.Automation.CompletionResultType.ParameterValue, "Warned"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Suspended".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Suspended'", "Suspended", global::System.Management.Automation.CompletionResultType.ParameterValue, "Suspended"); + } + 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) || "Unregistered".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Unregistered'", "Unregistered", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unregistered"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/SubscriptionState.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/SubscriptionState.TypeConverter.cs new file mode 100644 index 000000000000..019efb9dec88 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/SubscriptionState.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.DataBoxEdge.Support +{ + + /// TypeConverter implementation for SubscriptionState. + public partial class SubscriptionStateTypeConverter : + 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) => SubscriptionState.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/databoxedge/generated/api/Support/SubscriptionState.cs b/swaggerci/databoxedge/generated/api/Support/SubscriptionState.cs new file mode 100644 index 000000000000..a5e641862db3 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/SubscriptionState.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.DataBoxEdge.Support +{ + + public partial struct SubscriptionState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState Deleted = @"Deleted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState Registered = @"Registered"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState Suspended = @"Suspended"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState Unregistered = @"Unregistered"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState Warned = @"Warned"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SubscriptionState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SubscriptionState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SubscriptionState + /// 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.DataBoxEdge.Support.SubscriptionState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SubscriptionState (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 SubscriptionState && Equals((SubscriptionState)obj); + } + + /// Returns hashCode for enum SubscriptionState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private SubscriptionState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SubscriptionState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SubscriptionState + /// the value to convert to an instance of . + + public static implicit operator SubscriptionState(string value) + { + return new SubscriptionState(value); + } + + /// Implicit operator to convert SubscriptionState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState e) + { + return e._value; + } + + /// Overriding != operator for enum SubscriptionState + /// 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.DataBoxEdge.Support.SubscriptionState e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SubscriptionState + /// 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.DataBoxEdge.Support.SubscriptionState e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SubscriptionState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/TimeGrain.Completer.cs b/swaggerci/databoxedge/generated/api/Support/TimeGrain.Completer.cs new file mode 100644 index 000000000000..82a7174348a1 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/TimeGrain.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.DataBoxEdge.Support +{ + + /// Argument completer implementation for TimeGrain. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrainTypeConverter))] + public partial struct TimeGrain : + 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) || "PT1M".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PT1M'", "PT1M", global::System.Management.Automation.CompletionResultType.ParameterValue, "PT1M"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PT5M".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PT5M'", "PT5M", global::System.Management.Automation.CompletionResultType.ParameterValue, "PT5M"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PT15M".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PT15M'", "PT15M", global::System.Management.Automation.CompletionResultType.ParameterValue, "PT15M"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PT30M".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PT30M'", "PT30M", global::System.Management.Automation.CompletionResultType.ParameterValue, "PT30M"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PT1H".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PT1H'", "PT1H", global::System.Management.Automation.CompletionResultType.ParameterValue, "PT1H"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PT6H".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PT6H'", "PT6H", global::System.Management.Automation.CompletionResultType.ParameterValue, "PT6H"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PT12H".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PT12H'", "PT12H", global::System.Management.Automation.CompletionResultType.ParameterValue, "PT12H"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PT1D".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PT1D'", "PT1D", global::System.Management.Automation.CompletionResultType.ParameterValue, "PT1D"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/TimeGrain.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/TimeGrain.TypeConverter.cs new file mode 100644 index 000000000000..14318ef7ddf5 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/TimeGrain.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.DataBoxEdge.Support +{ + + /// TypeConverter implementation for TimeGrain. + public partial class TimeGrainTypeConverter : + 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) => TimeGrain.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/databoxedge/generated/api/Support/TimeGrain.cs b/swaggerci/databoxedge/generated/api/Support/TimeGrain.cs new file mode 100644 index 000000000000..d0fcffc7b88b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/TimeGrain.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.DataBoxEdge.Support +{ + + public partial struct TimeGrain : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain Pt12H = @"PT12H"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain Pt15M = @"PT15M"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain Pt1D = @"PT1D"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain Pt1H = @"PT1H"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain Pt1M = @"PT1M"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain Pt30M = @"PT30M"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain Pt5M = @"PT5M"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain Pt6H = @"PT6H"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to TimeGrain + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new TimeGrain(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type TimeGrain + /// 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.DataBoxEdge.Support.TimeGrain e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type TimeGrain (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 TimeGrain && Equals((TimeGrain)obj); + } + + /// Returns hashCode for enum TimeGrain + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the + /// the value to create an instance for. + private TimeGrain(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for TimeGrain + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to TimeGrain + /// the value to convert to an instance of . + + public static implicit operator TimeGrain(string value) + { + return new TimeGrain(value); + } + + /// Implicit operator to convert TimeGrain to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain e) + { + return e._value; + } + + /// Overriding != operator for enum TimeGrain + /// 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.DataBoxEdge.Support.TimeGrain e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum TimeGrain + /// 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.DataBoxEdge.Support.TimeGrain e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TimeGrain e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/TriggerEventType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/TriggerEventType.Completer.cs new file mode 100644 index 000000000000..16726011dc7c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/TriggerEventType.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.DataBoxEdge.Support +{ + + /// Trigger Kind. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventTypeTypeConverter))] + public partial struct TriggerEventType : + 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) || "FileEvent".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FileEvent'", "FileEvent", global::System.Management.Automation.CompletionResultType.ParameterValue, "FileEvent"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PeriodicTimerEvent".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PeriodicTimerEvent'", "PeriodicTimerEvent", global::System.Management.Automation.CompletionResultType.ParameterValue, "PeriodicTimerEvent"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/TriggerEventType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/TriggerEventType.TypeConverter.cs new file mode 100644 index 000000000000..0115a854ea60 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/TriggerEventType.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.DataBoxEdge.Support +{ + + /// Trigger Kind. + public partial class TriggerEventTypeTypeConverter : + 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) => TriggerEventType.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/databoxedge/generated/api/Support/TriggerEventType.cs b/swaggerci/databoxedge/generated/api/Support/TriggerEventType.cs new file mode 100644 index 000000000000..3ba5f76a0d4c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/TriggerEventType.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.DataBoxEdge.Support +{ + + /// Trigger Kind. + public partial struct TriggerEventType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType FileEvent = @"FileEvent"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType PeriodicTimerEvent = @"PeriodicTimerEvent"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to TriggerEventType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new TriggerEventType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type TriggerEventType + /// 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.DataBoxEdge.Support.TriggerEventType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type TriggerEventType (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 TriggerEventType && Equals((TriggerEventType)obj); + } + + /// Returns hashCode for enum TriggerEventType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for TriggerEventType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the + /// the value to create an instance for. + private TriggerEventType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to TriggerEventType + /// the value to convert to an instance of . + + public static implicit operator TriggerEventType(string value) + { + return new TriggerEventType(value); + } + + /// Implicit operator to convert TriggerEventType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType e) + { + return e._value; + } + + /// Overriding != operator for enum TriggerEventType + /// 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.DataBoxEdge.Support.TriggerEventType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum TriggerEventType + /// 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.DataBoxEdge.Support.TriggerEventType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/UpdateOperation.Completer.cs b/swaggerci/databoxedge/generated/api/Support/UpdateOperation.Completer.cs new file mode 100644 index 000000000000..6a185f8e4873 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// The current update operation. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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) || "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) || "Scan".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Scan'", "Scan", global::System.Management.Automation.CompletionResultType.ParameterValue, "Scan"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Download".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Download'", "Download", global::System.Management.Automation.CompletionResultType.ParameterValue, "Download"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Install".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Install'", "Install", global::System.Management.Automation.CompletionResultType.ParameterValue, "Install"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/UpdateOperation.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/UpdateOperation.TypeConverter.cs new file mode 100644 index 000000000000..2e617b0446be --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/api/Support/UpdateOperation.cs b/swaggerci/databoxedge/generated/api/Support/UpdateOperation.cs new file mode 100644 index 000000000000..aadf631e8563 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Support +{ + + /// The current update operation. + public partial struct UpdateOperation : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation Download = @"Download"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation Install = @"Install"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation Scan = @"Scan"; + + /// 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.DataBoxEdge.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 + /// 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.DataBoxEdge.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.DataBoxEdge.Support.UpdateOperation e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Support.UpdateOperation e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperation e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/UpdateOperationStage.Completer.cs b/swaggerci/databoxedge/generated/api/Support/UpdateOperationStage.Completer.cs new file mode 100644 index 000000000000..f113f25c155c --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/UpdateOperationStage.Completer.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.DataBoxEdge.Support +{ + + /// Current stage of the update operation. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStageTypeConverter))] + public partial struct UpdateOperationStage : + 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) || "Initial".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Initial'", "Initial", global::System.Management.Automation.CompletionResultType.ParameterValue, "Initial"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ScanStarted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ScanStarted'", "ScanStarted", global::System.Management.Automation.CompletionResultType.ParameterValue, "ScanStarted"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ScanComplete".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ScanComplete'", "ScanComplete", global::System.Management.Automation.CompletionResultType.ParameterValue, "ScanComplete"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ScanFailed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ScanFailed'", "ScanFailed", global::System.Management.Automation.CompletionResultType.ParameterValue, "ScanFailed"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DownloadStarted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DownloadStarted'", "DownloadStarted", global::System.Management.Automation.CompletionResultType.ParameterValue, "DownloadStarted"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DownloadComplete".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DownloadComplete'", "DownloadComplete", global::System.Management.Automation.CompletionResultType.ParameterValue, "DownloadComplete"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DownloadFailed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DownloadFailed'", "DownloadFailed", global::System.Management.Automation.CompletionResultType.ParameterValue, "DownloadFailed"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "InstallStarted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'InstallStarted'", "InstallStarted", global::System.Management.Automation.CompletionResultType.ParameterValue, "InstallStarted"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "InstallComplete".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'InstallComplete'", "InstallComplete", global::System.Management.Automation.CompletionResultType.ParameterValue, "InstallComplete"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "InstallFailed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'InstallFailed'", "InstallFailed", global::System.Management.Automation.CompletionResultType.ParameterValue, "InstallFailed"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RebootInitiated".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RebootInitiated'", "RebootInitiated", global::System.Management.Automation.CompletionResultType.ParameterValue, "RebootInitiated"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Success".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Success'", "Success", global::System.Management.Automation.CompletionResultType.ParameterValue, "Success"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failure".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failure'", "Failure", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failure"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RescanStarted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RescanStarted'", "RescanStarted", global::System.Management.Automation.CompletionResultType.ParameterValue, "RescanStarted"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RescanComplete".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RescanComplete'", "RescanComplete", global::System.Management.Automation.CompletionResultType.ParameterValue, "RescanComplete"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RescanFailed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RescanFailed'", "RescanFailed", global::System.Management.Automation.CompletionResultType.ParameterValue, "RescanFailed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/UpdateOperationStage.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/UpdateOperationStage.TypeConverter.cs new file mode 100644 index 000000000000..3346b32999f0 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/UpdateOperationStage.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.DataBoxEdge.Support +{ + + /// Current stage of the update operation. + public partial class UpdateOperationStageTypeConverter : + 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) => UpdateOperationStage.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/databoxedge/generated/api/Support/UpdateOperationStage.cs b/swaggerci/databoxedge/generated/api/Support/UpdateOperationStage.cs new file mode 100644 index 000000000000..5b72039a377b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/UpdateOperationStage.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.DataBoxEdge.Support +{ + + /// Current stage of the update operation. + public partial struct UpdateOperationStage : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage DownloadComplete = @"DownloadComplete"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage DownloadFailed = @"DownloadFailed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage DownloadStarted = @"DownloadStarted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage Failure = @"Failure"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage Initial = @"Initial"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage InstallComplete = @"InstallComplete"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage InstallFailed = @"InstallFailed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage InstallStarted = @"InstallStarted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage RebootInitiated = @"RebootInitiated"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage RescanComplete = @"RescanComplete"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage RescanFailed = @"RescanFailed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage RescanStarted = @"RescanStarted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage ScanComplete = @"ScanComplete"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage ScanFailed = @"ScanFailed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage ScanStarted = @"ScanStarted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage Success = @"Success"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage Unknown = @"Unknown"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to UpdateOperationStage + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new UpdateOperationStage(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type UpdateOperationStage + /// 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.DataBoxEdge.Support.UpdateOperationStage e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type UpdateOperationStage (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 UpdateOperationStage && Equals((UpdateOperationStage)obj); + } + + /// Returns hashCode for enum UpdateOperationStage + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for UpdateOperationStage + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the + /// the value to create an instance for. + private UpdateOperationStage(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to UpdateOperationStage + /// the value to convert to an instance of . + + public static implicit operator UpdateOperationStage(string value) + { + return new UpdateOperationStage(value); + } + + /// Implicit operator to convert UpdateOperationStage to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage e) + { + return e._value; + } + + /// Overriding != operator for enum UpdateOperationStage + /// 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.DataBoxEdge.Support.UpdateOperationStage e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum UpdateOperationStage + /// 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.DataBoxEdge.Support.UpdateOperationStage e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateOperationStage e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/UpdateStatus.Completer.cs b/swaggerci/databoxedge/generated/api/Support/UpdateStatus.Completer.cs new file mode 100644 index 000000000000..ba286cb55a2f --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/UpdateStatus.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.DataBoxEdge.Support +{ + + /// Status of the update. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateStatusTypeConverter))] + public partial struct UpdateStatus : + 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) || "DownloadPending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DownloadPending'", "DownloadPending", global::System.Management.Automation.CompletionResultType.ParameterValue, "DownloadPending"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DownloadStarted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DownloadStarted'", "DownloadStarted", global::System.Management.Automation.CompletionResultType.ParameterValue, "DownloadStarted"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DownloadCompleted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DownloadCompleted'", "DownloadCompleted", global::System.Management.Automation.CompletionResultType.ParameterValue, "DownloadCompleted"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "InstallStarted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'InstallStarted'", "InstallStarted", global::System.Management.Automation.CompletionResultType.ParameterValue, "InstallStarted"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "InstallCompleted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'InstallCompleted'", "InstallCompleted", global::System.Management.Automation.CompletionResultType.ParameterValue, "InstallCompleted"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/UpdateStatus.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/UpdateStatus.TypeConverter.cs new file mode 100644 index 000000000000..262fd9cf5966 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/UpdateStatus.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.DataBoxEdge.Support +{ + + /// Status of the update. + public partial class UpdateStatusTypeConverter : + 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) => UpdateStatus.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/databoxedge/generated/api/Support/UpdateStatus.cs b/swaggerci/databoxedge/generated/api/Support/UpdateStatus.cs new file mode 100644 index 000000000000..6eaab2d07a14 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/UpdateStatus.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.DataBoxEdge.Support +{ + + /// Status of the update. + public partial struct UpdateStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateStatus DownloadCompleted = @"DownloadCompleted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateStatus DownloadPending = @"DownloadPending"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateStatus DownloadStarted = @"DownloadStarted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateStatus InstallCompleted = @"InstallCompleted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateStatus InstallStarted = @"InstallStarted"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to UpdateStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new UpdateStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type UpdateStatus + /// 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.DataBoxEdge.Support.UpdateStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type UpdateStatus (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 UpdateStatus && Equals((UpdateStatus)obj); + } + + /// Returns hashCode for enum UpdateStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for UpdateStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the + /// the value to create an instance for. + private UpdateStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to UpdateStatus + /// the value to convert to an instance of . + + public static implicit operator UpdateStatus(string value) + { + return new UpdateStatus(value); + } + + /// Implicit operator to convert UpdateStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateStatus e) + { + return e._value; + } + + /// Overriding != operator for enum UpdateStatus + /// 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.DataBoxEdge.Support.UpdateStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum UpdateStatus + /// 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.DataBoxEdge.Support.UpdateStatus e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/UpdateType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/UpdateType.Completer.cs new file mode 100644 index 000000000000..42fe8f85b4d7 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/UpdateType.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.DataBoxEdge.Support +{ + + /// Type of the Update + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateTypeTypeConverter))] + public partial struct UpdateType : + 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) || "Software".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Software'", "Software", global::System.Management.Automation.CompletionResultType.ParameterValue, "Software"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Kubernetes".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Kubernetes'", "Kubernetes", global::System.Management.Automation.CompletionResultType.ParameterValue, "Kubernetes"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Firmware".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Firmware'", "Firmware", global::System.Management.Automation.CompletionResultType.ParameterValue, "Firmware"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/UpdateType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/UpdateType.TypeConverter.cs new file mode 100644 index 000000000000..10dc2bc5e33d --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/UpdateType.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.DataBoxEdge.Support +{ + + /// Type of the Update + public partial class UpdateTypeTypeConverter : + 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) => UpdateType.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/databoxedge/generated/api/Support/UpdateType.cs b/swaggerci/databoxedge/generated/api/Support/UpdateType.cs new file mode 100644 index 000000000000..e403be214a4b --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/UpdateType.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.DataBoxEdge.Support +{ + + /// Type of the Update + public partial struct UpdateType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateType Firmware = @"Firmware"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateType Kubernetes = @"Kubernetes"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateType Software = @"Software"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to UpdateType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new UpdateType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type UpdateType + /// 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.DataBoxEdge.Support.UpdateType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type UpdateType (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 UpdateType && Equals((UpdateType)obj); + } + + /// Returns hashCode for enum UpdateType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for UpdateType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the + /// the value to create an instance for. + private UpdateType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to UpdateType + /// the value to convert to an instance of . + + public static implicit operator UpdateType(string value) + { + return new UpdateType(value); + } + + /// Implicit operator to convert UpdateType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateType e) + { + return e._value; + } + + /// Overriding != operator for enum UpdateType + /// 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.DataBoxEdge.Support.UpdateType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum UpdateType + /// 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.DataBoxEdge.Support.UpdateType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UpdateType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/UserType.Completer.cs b/swaggerci/databoxedge/generated/api/Support/UserType.Completer.cs new file mode 100644 index 000000000000..046e024284b8 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/UserType.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.DataBoxEdge.Support +{ + + /// Type of the user. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserTypeTypeConverter))] + public partial struct UserType : + 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) || "Share".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Share'", "Share", global::System.Management.Automation.CompletionResultType.ParameterValue, "Share"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "LocalManagement".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'LocalManagement'", "LocalManagement", global::System.Management.Automation.CompletionResultType.ParameterValue, "LocalManagement"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ARM".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ARM'", "ARM", global::System.Management.Automation.CompletionResultType.ParameterValue, "ARM"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/api/Support/UserType.TypeConverter.cs b/swaggerci/databoxedge/generated/api/Support/UserType.TypeConverter.cs new file mode 100644 index 000000000000..1163b6ecd68a --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/UserType.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.DataBoxEdge.Support +{ + + /// Type of the user. + public partial class UserTypeTypeConverter : + 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) => UserType.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/databoxedge/generated/api/Support/UserType.cs b/swaggerci/databoxedge/generated/api/Support/UserType.cs new file mode 100644 index 000000000000..7371f4cb3544 --- /dev/null +++ b/swaggerci/databoxedge/generated/api/Support/UserType.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.DataBoxEdge.Support +{ + + /// Type of the user. + public partial struct UserType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType Arm = @"ARM"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType LocalManagement = @"LocalManagement"; + + public static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType Share = @"Share"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to UserType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new UserType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type UserType + /// 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.DataBoxEdge.Support.UserType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type UserType (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 UserType && Equals((UserType)obj); + } + + /// Returns hashCode for enum UserType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for UserType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the + /// the value to create an instance for. + private UserType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to UserType + /// the value to convert to an instance of . + + public static implicit operator UserType(string value) + { + return new UserType(value); + } + + /// Implicit operator to convert UserType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType e) + { + return e._value; + } + + /// Overriding != operator for enum UserType + /// 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.DataBoxEdge.Support.UserType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum UserType + /// 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.DataBoxEdge.Support.UserType e1, Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAddon_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAddon_Get.cs new file mode 100644 index 000000000000..89c3d8247800 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAddon_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets a specific addon by name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeAddon_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets a specific addon by name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeAddon_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The addon name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The addon name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The addon name.", + SerializedName = @"addonName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AddonName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _roleName; + + /// The role name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The role name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The role name.", + SerializedName = @"roleName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string RoleName { get => this._roleName; set => this._roleName = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeAddon_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AddonsGet(DeviceName, RoleName, Name, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,RoleName=RoleName,Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, RoleName=RoleName, Name=Name, 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 { DeviceName=DeviceName, RoleName=RoleName, Name=Name, 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 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.DataBoxEdge.Models.Api20220301.IAddon + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAddon_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAddon_GetViaIdentity.cs new file mode 100644 index 000000000000..68c9a3f3067c --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAddon_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets a specific addon by name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeAddon_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets a specific addon by name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeAddon_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeAddon_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AddonsGetViaIdentity(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.RoleName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RoleName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AddonName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AddonName"),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) ); + } + await this.Client.AddonsGet(InputObject.DeviceName ?? null, InputObject.RoleName ?? null, InputObject.AddonName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IAddon + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAddon_List.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAddon_List.cs new file mode 100644 index 000000000000..4496c3c918a9 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAddon_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Lists all the addons configured in the role. + /// + /// [OpenAPI] ListByRole=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeAddon_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Lists all the addons configured in the role.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeAddon_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _roleName; + + /// The role name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The role name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The role name.", + SerializedName = @"roleName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string RoleName { get => this._roleName; set => this._roleName = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeAddon_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AddonsListByRole(DeviceName, RoleName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,RoleName=RoleName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, RoleName=RoleName, 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 { DeviceName=DeviceName, RoleName=RoleName, 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 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.DataBoxEdge.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AddonsListByRole_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAlert_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAlert_Get.cs new file mode 100644 index 000000000000..a56145164d4f --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAlert_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets an alert by name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeAlert_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets an alert by name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeAlert_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The alert name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The alert name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The alert name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeAlert_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AlertsGet(DeviceName, Name, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Models.Api20220301.IAlert + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAlert_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAlert_GetViaIdentity.cs new file mode 100644 index 000000000000..a9c906b9adfe --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAlert_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets an alert by name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeAlert_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets an alert by name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeAlert_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeAlert_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AlertsGetViaIdentity(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.Name) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Name"),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) ); + } + await this.Client.AlertsGet(InputObject.DeviceName ?? null, InputObject.Name ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IAlert + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAlert_List.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAlert_List.cs new file mode 100644 index 000000000000..02ee5328f6a2 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAlert_List.cs @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets all the alerts for a Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] ListByDataBoxEdgeDevice=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeAlert_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAlert))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets all the alerts for a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeAlert_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeAlert_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AlertsListByDataBoxEdgeDevice(DeviceName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AlertsListByDataBoxEdgeDevice_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAvailableSku_List.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAvailableSku_List.cs new file mode 100644 index 000000000000..f17d9c239433 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeAvailableSku_List.cs @@ -0,0 +1,397 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// List all the available Skus and information related to them. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/availableSkus" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeAvailableSku_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeSku))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"List all the available Skus and information related to them.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeAvailableSku_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeAvailableSku_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AvailableSkusList(SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AvailableSkusList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeBandwidthSchedule_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeBandwidthSchedule_Get.cs new file mode 100644 index 000000000000..6d370e3bec16 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeBandwidthSchedule_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets the properties of the specified bandwidth schedule. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeBandwidthSchedule_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the properties of the specified bandwidth schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeBandwidthSchedule_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The bandwidth schedule name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The bandwidth schedule name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The bandwidth schedule name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeBandwidthSchedule_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BandwidthSchedulesGet(DeviceName, Name, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Models.Api20220301.IBandwidthSchedule + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeBandwidthSchedule_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeBandwidthSchedule_GetViaIdentity.cs new file mode 100644 index 000000000000..11b481484e3b --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeBandwidthSchedule_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets the properties of the specified bandwidth schedule. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeBandwidthSchedule_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the properties of the specified bandwidth schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeBandwidthSchedule_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeBandwidthSchedule_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BandwidthSchedulesGetViaIdentity(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.Name) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Name"),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) ); + } + await this.Client.BandwidthSchedulesGet(InputObject.DeviceName ?? null, InputObject.Name ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IBandwidthSchedule + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeBandwidthSchedule_List.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeBandwidthSchedule_List.cs new file mode 100644 index 000000000000..299a7f6008bf --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeBandwidthSchedule_List.cs @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] ListByDataBoxEdgeDevice=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeBandwidthSchedule_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeBandwidthSchedule_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeBandwidthSchedule_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BandwidthSchedulesListByDataBoxEdgeDevice(DeviceName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BandwidthSchedulesListByDataBoxEdgeDevice_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeContainer_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeContainer_Get.cs new file mode 100644 index 000000000000..6c41919abeb5 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeContainer_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets a container by name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeContainer_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets a container by name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeContainer_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The container Name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The container Name")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The container Name", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ContainerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _storageAccountName; + + /// The Storage Account Name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Storage Account Name")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Storage Account Name", + SerializedName = @"storageAccountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string StorageAccountName { get => this._storageAccountName; set => this._storageAccountName = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeContainer_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ContainersGet(DeviceName, StorageAccountName, Name, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,StorageAccountName=StorageAccountName,Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, StorageAccountName=StorageAccountName, Name=Name, 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 { DeviceName=DeviceName, StorageAccountName=StorageAccountName, Name=Name, 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 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.DataBoxEdge.Models.Api20220301.IContainer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeContainer_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeContainer_GetViaIdentity.cs new file mode 100644 index 000000000000..c694f1e5e5fc --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeContainer_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets a container by name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeContainer_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets a container by name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeContainer_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeContainer_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ContainersGetViaIdentity(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.StorageAccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.StorageAccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ContainerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ContainerName"),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) ); + } + await this.Client.ContainersGet(InputObject.DeviceName ?? null, InputObject.StorageAccountName ?? null, InputObject.ContainerName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IContainer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeContainer_List.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeContainer_List.cs new file mode 100644 index 000000000000..d8aaf14fcae7 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeContainer_List.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// + /// Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + /// + /// + /// [OpenAPI] ListByStorageAccount=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeContainer_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeContainer_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _storageAccountName; + + /// The storage Account name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The storage Account name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage Account name.", + SerializedName = @"storageAccountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string StorageAccountName { get => this._storageAccountName; set => this._storageAccountName = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeContainer_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ContainersListByStorageAccount(DeviceName, StorageAccountName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,StorageAccountName=StorageAccountName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, StorageAccountName=StorageAccountName, 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 { DeviceName=DeviceName, StorageAccountName=StorageAccountName, 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 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.DataBoxEdge.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ContainersListByStorageAccount_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo_Get.cs new file mode 100644 index 000000000000..929e2e05cb2b --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets the properties of the specified device capacity info. + /// + /// [OpenAPI] GetDeviceCapacityInfo=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/deviceCapacityInfo/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfo))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the properties of the specified device capacity info.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DeviceCapacityInfoGetDeviceCapacityInfo(SubscriptionId, ResourceGroupName, DeviceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,DeviceName=DeviceName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, DeviceName=DeviceName }) + { + 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, DeviceName=DeviceName }) + { + 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 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.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfo + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo_GetViaIdentity.cs new file mode 100644 index 000000000000..41742afa1bea --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo_GetViaIdentity.cs @@ -0,0 +1,383 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets the properties of the specified device capacity info. + /// + /// [OpenAPI] GetDeviceCapacityInfo=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/deviceCapacityInfo/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfo))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the properties of the specified device capacity info.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DeviceCapacityInfoGetDeviceCapacityInfoViaIdentity(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.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) ); + } + await this.Client.DeviceCapacityInfoGetDeviceCapacityInfo(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DeviceName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IDeviceCapacityInfo + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceExtendedInformation_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceExtendedInformation_Get.cs new file mode 100644 index 000000000000..53dd3c6dd4ba --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceExtendedInformation_Get.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// + /// Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. + /// + /// + /// [OpenAPI] GetExtendedInformation=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeDeviceExtendedInformation_Get", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets additional information for the specified Azure Stack Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeDeviceExtendedInformation_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeDeviceExtendedInformation_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesGetExtendedInformation' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesGetExtendedInformation(DeviceName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceExtendedInformation_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceExtendedInformation_GetViaIdentity.cs new file mode 100644 index 000000000000..a6f057504c11 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceExtendedInformation_GetViaIdentity.cs @@ -0,0 +1,387 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// + /// Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. + /// + /// + /// [OpenAPI] GetExtendedInformation=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeDeviceExtendedInformation_GetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets additional information for the specified Azure Stack Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeDeviceExtendedInformation_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeDeviceExtendedInformation_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesGetExtendedInformation' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesGetExtendedInformationViaIdentity(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) ); + } + await this.Client.DevicesGetExtendedInformation(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceNetworkSetting_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceNetworkSetting_Get.cs new file mode 100644 index 000000000000..ea8d1f809938 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceNetworkSetting_Get.cs @@ -0,0 +1,405 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// + /// Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + /// + /// + /// [OpenAPI] GetNetworkSettings=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeDeviceNetworkSetting_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettings))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the network settings of the specified Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeDeviceNetworkSetting_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeDeviceNetworkSetting_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesGetNetworkSettings(DeviceName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Models.Api20220301.INetworkSettings + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceNetworkSetting_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceNetworkSetting_GetViaIdentity.cs new file mode 100644 index 000000000000..2d072530023e --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceNetworkSetting_GetViaIdentity.cs @@ -0,0 +1,384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// + /// Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + /// + /// + /// [OpenAPI] GetNetworkSettings=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeDeviceNetworkSetting_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INetworkSettings))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the network settings of the specified Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeDeviceNetworkSetting_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeDeviceNetworkSetting_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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) ); + } + await this.Client.DevicesGetNetworkSettings(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.INetworkSettings + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceUpdateSummary_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceUpdateSummary_Get.cs new file mode 100644 index 000000000000..89daf7e0dcd9 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceUpdateSummary_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// + /// Gets information about the availability of updates based on the last scan of the device. It also gets information about + /// any ongoing download or install jobs on the device. + /// + /// + /// [OpenAPI] GetUpdateSummary=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeDeviceUpdateSummary_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummary))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets information about the availability of updates based on the last scan of the device. It also gets information about any ongoing download or install jobs on the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeDeviceUpdateSummary_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeDeviceUpdateSummary_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesGetUpdateSummary(DeviceName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Models.Api20220301.IUpdateSummary + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceUpdateSummary_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceUpdateSummary_GetViaIdentity.cs new file mode 100644 index 000000000000..6a667f0dd5be --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDeviceUpdateSummary_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// + /// Gets information about the availability of updates based on the last scan of the device. It also gets information about + /// any ongoing download or install jobs on the device. + /// + /// + /// [OpenAPI] GetUpdateSummary=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeDeviceUpdateSummary_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUpdateSummary))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets information about the availability of updates based on the last scan of the device. It also gets information about any ongoing download or install jobs on the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeDeviceUpdateSummary_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeDeviceUpdateSummary_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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) ); + } + await this.Client.DevicesGetUpdateSummary(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IUpdateSummary + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDevice_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDevice_Get.cs new file mode 100644 index 000000000000..26918b6366fc --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDevice_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets the properties of the Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeDevice_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the properties of the Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeDevice_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeDevice_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesGet(Name, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDevice_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDevice_GetViaIdentity.cs new file mode 100644 index 000000000000..422854d83c95 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDevice_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets the properties of the Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeDevice_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the properties of the Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeDevice_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeDevice_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesGetViaIdentity(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) ); + } + await this.Client.DevicesGet(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDevice_List.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDevice_List.cs new file mode 100644 index 000000000000..32b7dacb0450 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDevice_List.cs @@ -0,0 +1,414 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + /// + /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeDevice_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets all the Data Box Edge/Data Box Gateway devices in a subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeDevice_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 resource or Specify $skipToken= to populate + /// the next page in the list. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specify $expand=details to populate additional fields related to the resource or Specify $skipToken= to populate the next page in the list.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specify $expand=details to populate additional fields related to the resource or Specify $skipToken= to populate the next page in the list.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeDevice_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesListBySubscription(SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, 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, 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 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.DataBoxEdge.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesListBySubscription_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDevice_List1.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDevice_List1.cs new file mode 100644 index 000000000000..19bc217bdf42 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDevice_List1.cs @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + /// + /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeDevice_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets all the Data Box Edge/Data Box Gateway devices in a resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeDevice_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 resource or Specify $skipToken= to populate + /// the next page in the list. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specify $expand=details to populate additional fields related to the resource or Specify $skipToken= to populate the next page in the list.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specify $expand=details to populate additional fields related to the resource or Specify $skipToken= to populate the next page in the list.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeDevice_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesListByResourceGroup(SubscriptionId, ResourceGroupName, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, 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, 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 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.DataBoxEdge.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesListByResourceGroup_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting_Get.cs new file mode 100644 index 000000000000..1bb860a1539c --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// + /// Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. + /// + /// + /// [OpenAPI] GetDiagnosticProactiveLogCollectionSettings=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticProactiveLogCollectionSettings/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DiagnosticSettingsGetDiagnosticProactiveLogCollectionSettings(DeviceName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting_GetViaIdentity.cs new file mode 100644 index 000000000000..4907c4303913 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// + /// Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. + /// + /// + /// [OpenAPI] GetDiagnosticProactiveLogCollectionSettings=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticProactiveLogCollectionSettings/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DiagnosticSettingsGetDiagnosticProactiveLogCollectionSettingsViaIdentity(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) ); + } + await this.Client.DiagnosticSettingsGetDiagnosticProactiveLogCollectionSettings(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IDiagnosticProactiveLogCollectionSettings + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting_Get.cs new file mode 100644 index 000000000000..af534dca8308 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// + /// Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. + /// + /// + /// [OpenAPI] GetDiagnosticRemoteSupportSettings=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticRemoteSupportSettings/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DiagnosticSettingsGetDiagnosticRemoteSupportSettings(DeviceName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting_GetViaIdentity.cs new file mode 100644 index 000000000000..edcca7ecf490 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// + /// Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. + /// + /// + /// [OpenAPI] GetDiagnosticRemoteSupportSettings=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticRemoteSupportSettings/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DiagnosticSettingsGetDiagnosticRemoteSupportSettingsViaIdentity(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) ); + } + await this.Client.DiagnosticSettingsGetDiagnosticRemoteSupportSettings(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IDiagnosticRemoteSupportSettings + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeJob_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeJob_Get.cs new file mode 100644 index 000000000000..056afb1c014d --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeJob_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/jobs/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeJob_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJob))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the details of a specified job on a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeJob_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The job name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeJob_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.JobsGet(DeviceName, Name, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Models.Api20220301.IJob + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeJob_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeJob_GetViaIdentity.cs new file mode 100644 index 000000000000..3a0ba682435d --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeJob_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/jobs/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeJob_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJob))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the details of a specified job on a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeJob_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeJob_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.Name) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Name"),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) ); + } + await this.Client.JobsGet(InputObject.DeviceName ?? null, InputObject.Name ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IJob + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeMonitoringConfig_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeMonitoringConfig_Get.cs new file mode 100644 index 000000000000..b923f084bf1e --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeMonitoringConfig_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets a metric configuration of a role. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeMonitoringConfig_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets a metric configuration of a role.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeMonitoringConfig_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _roleName; + + /// The role name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The role name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The role name.", + SerializedName = @"roleName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string RoleName { get => this._roleName; set => this._roleName = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeMonitoringConfig_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MonitoringConfigGet(DeviceName, RoleName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,RoleName=RoleName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, RoleName=RoleName, 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 { DeviceName=DeviceName, RoleName=RoleName, 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 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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeMonitoringConfig_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeMonitoringConfig_GetViaIdentity.cs new file mode 100644 index 000000000000..b309dadac03c --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeMonitoringConfig_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets a metric configuration of a role. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeMonitoringConfig_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets a metric configuration of a role.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeMonitoringConfig_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeMonitoringConfig_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.MonitoringConfigGetViaIdentity(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.RoleName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RoleName"),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) ); + } + await this.Client.MonitoringConfigGet(InputObject.DeviceName ?? null, InputObject.RoleName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeMonitoringConfig_List.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeMonitoringConfig_List.cs new file mode 100644 index 000000000000..cfc2ae1ac292 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeMonitoringConfig_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Lists metric configurations in a role. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeMonitoringConfig_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Lists metric configurations in a role.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeMonitoringConfig_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _roleName; + + /// The role name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The role name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The role name.", + SerializedName = @"roleName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string RoleName { get => this._roleName; set => this._roleName = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeMonitoringConfig_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MonitoringConfigList(DeviceName, RoleName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,RoleName=RoleName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, RoleName=RoleName, 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 { DeviceName=DeviceName, RoleName=RoleName, 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 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.DataBoxEdge.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MonitoringConfigList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeNode_List.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeNode_List.cs new file mode 100644 index 000000000000..0a1e57ceca8d --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeNode_List.cs @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets all the nodes currently configured under this Data Box Edge device + /// + /// [OpenAPI] ListByDataBoxEdgeDevice=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeNode_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.INode))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets all the nodes currently configured under this Data Box Edge device")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeNode_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeNode_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.NodesListByDataBoxEdgeDevice(DeviceName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.NodesListByDataBoxEdgeDevice_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOperation_List.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOperation_List.cs new file mode 100644 index 000000000000..5c3a43f1ec7c --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOperation_List.cs @@ -0,0 +1,377 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// List all the supported operations. + /// + /// [OpenAPI] List=>GET:"/providers/Microsoft.DataBoxEdge/operations" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeOperation_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"List all the supported operations.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeOperation_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeOperation_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OperationsList(onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OperationsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOperationsStatus_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOperationsStatus_Get.cs new file mode 100644 index 000000000000..cf62c9fe1d8d --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOperationsStatus_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/operationsStatus/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeOperationsStatus_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJob))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the details of a specified job on a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeOperationsStatus_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The job name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeOperationsStatus_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OperationsStatusGet(DeviceName, Name, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Models.Api20220301.IJob + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOperationsStatus_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOperationsStatus_GetViaIdentity.cs new file mode 100644 index 000000000000..ae5072b32bf4 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOperationsStatus_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/operationsStatus/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeOperationsStatus_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IJob))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the details of a specified job on a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeOperationsStatus_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeOperationsStatus_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.OperationsStatusGetViaIdentity(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.Name) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Name"),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) ); + } + await this.Client.OperationsStatusGet(InputObject.DeviceName ?? null, InputObject.Name ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IJob + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOrderDcAccessCode_List.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOrderDcAccessCode_List.cs new file mode 100644 index 000000000000..fbbfc5456961 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOrderDcAccessCode_List.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets the DCAccess Code + /// + /// [OpenAPI] ListDCAccessCode=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default/listDCAccessCode" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeOrderDcAccessCode_List", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDcAccessCodeProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the DCAccess Code")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeOrderDcAccessCode_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeOrderDcAccessCode_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'OrdersListDcAccessCode' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OrdersListDcAccessCode(DeviceName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Models.Api20220301.IDcAccessCode + WriteObject((await response).AuthCode); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOrder_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOrder_Get.cs new file mode 100644 index 000000000000..4dad06f2aeab --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOrder_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets a specific order by name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeOrder_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets a specific order by name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeOrder_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeOrder_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OrdersGet(DeviceName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Models.Api20220301.IOrder + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOrder_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOrder_GetViaIdentity.cs new file mode 100644 index 000000000000..aa94ee6219b5 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOrder_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets a specific order by name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeOrder_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets a specific order by name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeOrder_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeOrder_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.OrdersGetViaIdentity(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) ); + } + await this.Client.OrdersGet(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IOrder + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOrder_List.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOrder_List.cs new file mode 100644 index 000000000000..29691e2705f0 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeOrder_List.cs @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Lists all the orders related to a Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] ListByDataBoxEdgeDevice=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeOrder_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Lists all the orders related to a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeOrder_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeOrder_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OrdersListByDataBoxEdgeDevice(DeviceName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OrdersListByDataBoxEdgeDevice_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeRole_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeRole_Get.cs new file mode 100644 index 000000000000..806c65c3a07a --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeRole_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets a specific role by name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeRole_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets a specific role by name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeRole_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The role name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The role name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The role name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeRole_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RolesGet(DeviceName, Name, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Models.Api20220301.IRole + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeRole_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeRole_GetViaIdentity.cs new file mode 100644 index 000000000000..ad3ebb7f9e6e --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeRole_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets a specific role by name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeRole_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets a specific role by name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeRole_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeRole_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.RolesGetViaIdentity(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.Name) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Name"),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) ); + } + await this.Client.RolesGet(InputObject.DeviceName ?? null, InputObject.Name ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IRole + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeRole_List.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeRole_List.cs new file mode 100644 index 000000000000..e0f1f33c657a --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeRole_List.cs @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] ListByDataBoxEdgeDevice=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeRole_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Lists all the roles configured in a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeRole_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeRole_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RolesListByDataBoxEdgeDevice(DeviceName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RolesListByDataBoxEdgeDevice_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeShare_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeShare_Get.cs new file mode 100644 index 000000000000..6d4b04ae0781 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeShare_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets a share by name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeShare_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets a share by name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeShare_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The share name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The share name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The share name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeShare_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SharesGet(DeviceName, Name, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Models.Api20220301.IShare + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeShare_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeShare_GetViaIdentity.cs new file mode 100644 index 000000000000..4ed01c1fa411 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeShare_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets a share by name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeShare_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets a share by name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeShare_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeShare_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SharesGetViaIdentity(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.Name) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Name"),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) ); + } + await this.Client.SharesGet(InputObject.DeviceName ?? null, InputObject.Name ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IShare + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeShare_List.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeShare_List.cs new file mode 100644 index 000000000000..4159f28483b7 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeShare_List.cs @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Lists all the shares in a Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] ListByDataBoxEdgeDevice=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeShare_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Lists all the shares in a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeShare_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeShare_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SharesListByDataBoxEdgeDevice(DeviceName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SharesListByDataBoxEdgeDevice_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeStorageAccountCredentials_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeStorageAccountCredentials_Get.cs new file mode 100644 index 000000000000..ed44e4fed808 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeStorageAccountCredentials_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets the properties of the specified storage account credential. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeStorageAccountCredentials_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the properties of the specified storage account credential.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeStorageAccountCredentials_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The storage account credential name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The storage account credential name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage account credential name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeStorageAccountCredentials_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountCredentialsGet(DeviceName, Name, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Models.Api20220301.IStorageAccountCredential + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeStorageAccountCredentials_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeStorageAccountCredentials_GetViaIdentity.cs new file mode 100644 index 000000000000..01d94872fdcf --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeStorageAccountCredentials_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets the properties of the specified storage account credential. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeStorageAccountCredentials_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the properties of the specified storage account credential.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeStorageAccountCredentials_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeStorageAccountCredentials_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.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.Name) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Name"),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) ); + } + await this.Client.StorageAccountCredentialsGet(InputObject.DeviceName ?? null, InputObject.Name ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IStorageAccountCredential + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeStorageAccountCredentials_List.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeStorageAccountCredentials_List.cs new file mode 100644 index 000000000000..01e568ad0bef --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeStorageAccountCredentials_List.cs @@ -0,0 +1,427 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// + /// Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + /// + /// + /// [OpenAPI] ListByDataBoxEdgeDevice=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeStorageAccountCredentials_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeStorageAccountCredentials_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeStorageAccountCredentials_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountCredentialsListByDataBoxEdgeDevice(DeviceName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountCredentialsListByDataBoxEdgeDevice_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeStorageAccount_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeStorageAccount_Get.cs new file mode 100644 index 000000000000..911747156c02 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeStorageAccount_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets a StorageAccount by name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeStorageAccount_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets a StorageAccount by name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeStorageAccount_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The storage account name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The storage account name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage account name.", + SerializedName = @"storageAccountName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("StorageAccountName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeStorageAccount_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsGet(DeviceName, Name, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Models.Api20220301.IStorageAccount + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeStorageAccount_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeStorageAccount_GetViaIdentity.cs new file mode 100644 index 000000000000..b71aca8b5b49 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeStorageAccount_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets a StorageAccount by name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeStorageAccount_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets a StorageAccount by name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeStorageAccount_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeStorageAccount_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.StorageAccountsGetViaIdentity(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.StorageAccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.StorageAccountName"),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) ); + } + await this.Client.StorageAccountsGet(InputObject.DeviceName ?? null, InputObject.StorageAccountName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IStorageAccount + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeStorageAccount_List.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeStorageAccount_List.cs new file mode 100644 index 000000000000..5bf0448c459a --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeStorageAccount_List.cs @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] ListByDataBoxEdgeDevice=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeStorageAccount_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeStorageAccount_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeStorageAccount_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsListByDataBoxEdgeDevice(DeviceName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsListByDataBoxEdgeDevice_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeTrigger_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeTrigger_Get.cs new file mode 100644 index 000000000000..32f468d8c95d --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeTrigger_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Get a specific trigger by name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeTrigger_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Get a specific trigger by name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeTrigger_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The trigger name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The trigger name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The trigger name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeTrigger_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TriggersGet(DeviceName, Name, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Models.Api20220301.ITrigger + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeTrigger_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeTrigger_GetViaIdentity.cs new file mode 100644 index 000000000000..7f876aa570c8 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeTrigger_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Get a specific trigger by name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeTrigger_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Get a specific trigger by name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeTrigger_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeTrigger_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TriggersGetViaIdentity(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.Name) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Name"),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) ); + } + await this.Client.TriggersGet(InputObject.DeviceName ?? null, InputObject.Name ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.ITrigger + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeTrigger_List.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeTrigger_List.cs new file mode 100644 index 000000000000..4d8f0e89ac3a --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeTrigger_List.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Lists all the triggers configured in the device. + /// + /// [OpenAPI] ListByDataBoxEdgeDevice=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeTrigger_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Lists all the triggers configured in the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeTrigger_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _filter; + + /// + /// Specify $filter='CustomContextTag eq ' to filter on custom context tag property + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specify $filter='CustomContextTag eq ' to filter on custom context tag property")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specify $filter='CustomContextTag eq ' to filter on custom context tag property", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeTrigger_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TriggersListByDataBoxEdgeDevice(DeviceName, SubscriptionId, ResourceGroupName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, 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, 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 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.DataBoxEdge.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TriggersListByDataBoxEdgeDevice_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeUser_Get.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeUser_Get.cs new file mode 100644 index 000000000000..de8e0325d7e9 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeUser_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets the properties of the specified user. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeUser_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the properties of the specified user.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeUser_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The user name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The user name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The user name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeUser_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.UsersGet(DeviceName, Name, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Models.Api20220301.IUser + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeUser_GetViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeUser_GetViaIdentity.cs new file mode 100644 index 000000000000..6a782a31fe12 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeUser_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets the properties of the specified user. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeUser_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets the properties of the specified user.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeUser_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeUser_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.UsersGetViaIdentity(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.Name) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Name"),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) ); + } + await this.Client.UsersGet(InputObject.DeviceName ?? null, InputObject.Name ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IUser + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeUser_List.cs b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeUser_List.cs new file mode 100644 index 000000000000..04be7a486f85 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/GetAzDataBoxEdgeUser_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Gets all the users registered on a Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] ListByDataBoxEdgeDevice=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataBoxEdgeUser_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets all the users registered on a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class GetAzDataBoxEdgeUser_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _filter; + + /// Specify $filter='Type eq ' to filter on user type property + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specify $filter='Type eq ' to filter on user type property")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specify $filter='Type eq ' to filter on user type property", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 GetAzDataBoxEdgeUser_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.UsersListByDataBoxEdgeDevice(DeviceName, SubscriptionId, ResourceGroupName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, 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, 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 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.DataBoxEdge.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.UsersListByDataBoxEdgeDevice_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/InstallAzDataBoxEdgeDeviceUpdate_Install.cs b/swaggerci/databoxedge/generated/cmdlets/InstallAzDataBoxEdgeDeviceUpdate_Install.cs new file mode 100644 index 000000000000..3ca6c9431e86 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/InstallAzDataBoxEdgeDeviceUpdate_Install.cs @@ -0,0 +1,474 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Installs the updates on the Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] InstallUpdates=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Install, @"AzDataBoxEdgeDeviceUpdate_Install", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Installs the updates on the Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class InstallAzDataBoxEdgeDeviceUpdate_Install : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of InstallAzDataBoxEdgeDeviceUpdate_Install + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.InstallAzDataBoxEdgeDeviceUpdate_Install Clone() + { + var clone = new InstallAzDataBoxEdgeDeviceUpdate_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; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InstallAzDataBoxEdgeDeviceUpdate_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesInstallUpdates(DeviceName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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/databoxedge/generated/cmdlets/InstallAzDataBoxEdgeDeviceUpdate_InstallViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/InstallAzDataBoxEdgeDeviceUpdate_InstallViaIdentity.cs new file mode 100644 index 000000000000..b2e5302d0e9b --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/InstallAzDataBoxEdgeDeviceUpdate_InstallViaIdentity.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Installs the updates on the Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] InstallUpdates=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Install, @"AzDataBoxEdgeDeviceUpdate_InstallViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Installs the updates on the Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class InstallAzDataBoxEdgeDeviceUpdate_InstallViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of InstallAzDataBoxEdgeDeviceUpdate_InstallViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.InstallAzDataBoxEdgeDeviceUpdate_InstallViaIdentity Clone() + { + var clone = new InstallAzDataBoxEdgeDeviceUpdate_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 InstallAzDataBoxEdgeDeviceUpdate_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesInstallUpdatesViaIdentity(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) ); + } + await this.Client.DevicesInstallUpdates(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// + /// 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/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeDownloadDeviceUpdate_Download.cs b/swaggerci/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeDownloadDeviceUpdate_Download.cs new file mode 100644 index 000000000000..1cb2f81b6e92 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeDownloadDeviceUpdate_Download.cs @@ -0,0 +1,474 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Downloads the updates on a Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] DownloadUpdates=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataBoxEdgeDownloadDeviceUpdate_Download", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Downloads the updates on a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class InvokeAzDataBoxEdgeDownloadDeviceUpdate_Download : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of InvokeAzDataBoxEdgeDownloadDeviceUpdate_Download + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.InvokeAzDataBoxEdgeDownloadDeviceUpdate_Download Clone() + { + var clone = new InvokeAzDataBoxEdgeDownloadDeviceUpdate_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; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzDataBoxEdgeDownloadDeviceUpdate_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesDownloadUpdates(DeviceName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeDownloadDeviceUpdate_DownloadViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeDownloadDeviceUpdate_DownloadViaIdentity.cs new file mode 100644 index 000000000000..2f3d0aae9199 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeDownloadDeviceUpdate_DownloadViaIdentity.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Downloads the updates on a Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] DownloadUpdates=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataBoxEdgeDownloadDeviceUpdate_DownloadViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Downloads the updates on a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class InvokeAzDataBoxEdgeDownloadDeviceUpdate_DownloadViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzDataBoxEdgeDownloadDeviceUpdate_DownloadViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.InvokeAzDataBoxEdgeDownloadDeviceUpdate_DownloadViaIdentity Clone() + { + var clone = new InvokeAzDataBoxEdgeDownloadDeviceUpdate_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 InvokeAzDataBoxEdgeDownloadDeviceUpdate_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesDownloadUpdatesViaIdentity(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) ); + } + await this.Client.DevicesDownloadUpdates(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// + /// 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/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeScanDevice_Scan.cs b/swaggerci/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeScanDevice_Scan.cs new file mode 100644 index 000000000000..21d4a62329cd --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeScanDevice_Scan.cs @@ -0,0 +1,474 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Scans for updates on a Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] ScanForUpdates=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataBoxEdgeScanDevice_Scan", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Scans for updates on a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class InvokeAzDataBoxEdgeScanDevice_Scan : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of InvokeAzDataBoxEdgeScanDevice_Scan + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.InvokeAzDataBoxEdgeScanDevice_Scan Clone() + { + var clone = new InvokeAzDataBoxEdgeScanDevice_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; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzDataBoxEdgeScanDevice_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesScanForUpdates(DeviceName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeScanDevice_ScanViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeScanDevice_ScanViaIdentity.cs new file mode 100644 index 000000000000..7ea8123d7c63 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeScanDevice_ScanViaIdentity.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Scans for updates on a Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] ScanForUpdates=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataBoxEdgeScanDevice_ScanViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Scans for updates on a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class InvokeAzDataBoxEdgeScanDevice_ScanViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of InvokeAzDataBoxEdgeScanDevice_ScanViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.InvokeAzDataBoxEdgeScanDevice_ScanViaIdentity Clone() + { + var clone = new InvokeAzDataBoxEdgeScanDevice_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 InvokeAzDataBoxEdgeScanDevice_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesScanForUpdatesViaIdentity(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) ); + } + await this.Client.DevicesScanForUpdates(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// + /// 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/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeUploadDeviceCertificate_Upload.cs b/swaggerci/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeUploadDeviceCertificate_Upload.cs new file mode 100644 index 000000000000..524b959033a7 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeUploadDeviceCertificate_Upload.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Uploads registration certificate for the device. + /// + /// [OpenAPI] UploadCertificate=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataBoxEdgeUploadDeviceCertificate_Upload", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Uploads registration certificate for the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class InvokeAzDataBoxEdgeUploadDeviceCertificate_Upload : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest _parameter; + + /// The upload certificate request. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The upload certificate request.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The upload certificate request.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 InvokeAzDataBoxEdgeUploadDeviceCertificate_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesUploadCertificate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesUploadCertificate(DeviceName, SubscriptionId, ResourceGroupName, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, body=Parameter }) + { + 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, body=Parameter }) + { + 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 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.DataBoxEdge.Models.Api20220301.IUploadCertificateResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeUploadDeviceCertificate_UploadExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeUploadDeviceCertificate_UploadExpanded.cs new file mode 100644 index 000000000000..12b844b4f383 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeUploadDeviceCertificate_UploadExpanded.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Uploads registration certificate for the device. + /// + /// [OpenAPI] UploadCertificate=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataBoxEdgeUploadDeviceCertificate_UploadExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Uploads registration certificate for the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class InvokeAzDataBoxEdgeUploadDeviceCertificate_UploadExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 authentication type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The authentication type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The authentication type.", + SerializedName = @"authenticationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType AuthenticationType { get => ParametersBody.AuthenticationType ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType)""); set => ParametersBody.AuthenticationType = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The base64 encoded certificate raw data. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The base64 encoded certificate raw data.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The base64 encoded certificate raw data.", + SerializedName = @"certificate", + PossibleTypes = new [] { typeof(string) })] + public string Certificate { get => ParametersBody.Certificate ?? null; set => ParametersBody.Certificate = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UploadCertificateRequest(); + + /// The upload certificate request. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 InvokeAzDataBoxEdgeUploadDeviceCertificate_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesUploadCertificate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesUploadCertificate(DeviceName, SubscriptionId, ResourceGroupName, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, 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 { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, 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 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.DataBoxEdge.Models.Api20220301.IUploadCertificateResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeUploadDeviceCertificate_UploadViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeUploadDeviceCertificate_UploadViaIdentity.cs new file mode 100644 index 000000000000..73100191e14f --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeUploadDeviceCertificate_UploadViaIdentity.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Uploads registration certificate for the device. + /// + /// [OpenAPI] UploadCertificate=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataBoxEdgeUploadDeviceCertificate_UploadViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Uploads registration certificate for the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class InvokeAzDataBoxEdgeUploadDeviceCertificate_UploadViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest _parameter; + + /// The upload certificate request. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The upload certificate request.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The upload certificate request.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 InvokeAzDataBoxEdgeUploadDeviceCertificate_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesUploadCertificate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesUploadCertificateViaIdentity(InputObject.Id, Parameter, 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) ); + } + await this.Client.DevicesUploadCertificate(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + 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=Parameter }) + { + 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 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.DataBoxEdge.Models.Api20220301.IUploadCertificateResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeUploadDeviceCertificate_UploadViaIdentityExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeUploadDeviceCertificate_UploadViaIdentityExpanded.cs new file mode 100644 index 000000000000..ab2e3a4c4c0c --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/InvokeAzDataBoxEdgeUploadDeviceCertificate_UploadViaIdentityExpanded.cs @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Uploads registration certificate for the device. + /// + /// [OpenAPI] UploadCertificate=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzDataBoxEdgeUploadDeviceCertificate_UploadViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Uploads registration certificate for the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class InvokeAzDataBoxEdgeUploadDeviceCertificate_UploadViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 authentication type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The authentication type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The authentication type.", + SerializedName = @"authenticationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType AuthenticationType { get => ParametersBody.AuthenticationType ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AuthenticationType)""); set => ParametersBody.AuthenticationType = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The base64 encoded certificate raw data. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The base64 encoded certificate raw data.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The base64 encoded certificate raw data.", + SerializedName = @"certificate", + PossibleTypes = new [] { typeof(string) })] + public string Certificate { get => ParametersBody.Certificate ?? null; set => ParametersBody.Certificate = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.UploadCertificateRequest(); + + /// The upload certificate request. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUploadCertificateRequest ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 InvokeAzDataBoxEdgeUploadDeviceCertificate_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesUploadCertificate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesUploadCertificateViaIdentity(InputObject.Id, ParametersBody, 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) ); + } + await this.Client.DevicesUploadCertificate(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, ParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IUploadCertificateResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeAddon_CreateExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeAddon_CreateExpanded.cs new file mode 100644 index 000000000000..1d3888239b32 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeAddon_CreateExpanded.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Create or update a addon. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataBoxEdgeAddon_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Create or update a addon.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class NewAzDataBoxEdgeAddon_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon _addonBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Addon(); + + /// Role Addon + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IAddon AddonBody { get => this._addonBody; set => this._addonBody = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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; } } + + /// Addon type. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Addon type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Addon type.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AddonType Kind { get => AddonBody.Kind; set => AddonBody.Kind = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The addon name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The addon name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The addon name.", + SerializedName = @"addonName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AddonName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _roleName; + + /// The role name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The role name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The role name.", + SerializedName = @"roleName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string RoleName { get => this._roleName; set => this._roleName = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzDataBoxEdgeAddon_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.NewAzDataBoxEdgeAddon_CreateExpanded Clone() + { + var clone = new NewAzDataBoxEdgeAddon_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.AddonBody = this.AddonBody; + clone.DeviceName = this.DeviceName; + clone.RoleName = this.RoleName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 NewAzDataBoxEdgeAddon_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AddonsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AddonsCreateOrUpdate(DeviceName, RoleName, Name, SubscriptionId, ResourceGroupName, AddonBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,RoleName=RoleName,Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,body=AddonBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, RoleName=RoleName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, body=AddonBody }) + { + 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, RoleName=RoleName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, body=AddonBody }) + { + 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 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.DataBoxEdge.Models.Api20220301.IAddon + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeBandwidthSchedule_CreateExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeBandwidthSchedule_CreateExpanded.cs new file mode 100644 index 000000000000..9ed4d0ccf7f7 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeBandwidthSchedule_CreateExpanded.cs @@ -0,0 +1,537 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Creates or updates a bandwidth schedule. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataBoxEdgeBandwidthSchedule_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Creates or updates a bandwidth schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class NewAzDataBoxEdgeBandwidthSchedule_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.ClientAPI; + + /// The days of the week when this schedule is applicable. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The days of the week when this schedule is applicable.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The days of the week when this schedule is applicable.", + SerializedName = @"days", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DayOfWeek[] Day { get => ParametersBody.Day ?? null /* arrayOf */; set => ParametersBody.Day = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The bandwidth schedule name which needs to be added/updated. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The bandwidth schedule name which needs to be added/updated.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The bandwidth schedule name which needs to be added/updated.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.BandwidthSchedule(); + + /// The bandwidth schedule details. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IBandwidthSchedule ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The bandwidth rate in Mbps. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The bandwidth rate in Mbps.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The bandwidth rate in Mbps.", + SerializedName = @"rateInMbps", + PossibleTypes = new [] { typeof(int) })] + public int RateInMbps { get => ParametersBody.RateInMbps; set => ParametersBody.RateInMbps = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// The start time of the schedule in UTC. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The start time of the schedule in UTC.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The start time of the schedule in UTC.", + SerializedName = @"start", + PossibleTypes = new [] { typeof(string) })] + public string Start { get => ParametersBody.Start ?? null; set => ParametersBody.Start = value; } + + /// The stop time of the schedule in UTC. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The stop time of the schedule in UTC.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The stop time of the schedule in UTC.", + SerializedName = @"stop", + PossibleTypes = new [] { typeof(string) })] + public string Stop { get => ParametersBody.Stop ?? null; set => ParametersBody.Stop = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzDataBoxEdgeBandwidthSchedule_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.NewAzDataBoxEdgeBandwidthSchedule_CreateExpanded Clone() + { + var clone = new NewAzDataBoxEdgeBandwidthSchedule_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.ParametersBody = this.ParametersBody; + clone.DeviceName = this.DeviceName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 NewAzDataBoxEdgeBandwidthSchedule_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BandwidthSchedulesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BandwidthSchedulesCreateOrUpdate(DeviceName, Name, SubscriptionId, ResourceGroupName, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, 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 { DeviceName=DeviceName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, 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 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.DataBoxEdge.Models.Api20220301.IBandwidthSchedule + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeContainer_CreateExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeContainer_CreateExpanded.cs new file mode 100644 index 000000000000..9069f31c778a --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeContainer_CreateExpanded.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Creates a new container or updates an existing container on the device. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataBoxEdgeContainer_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Creates a new container or updates an existing container on the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class NewAzDataBoxEdgeContainer_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer _containerBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Container(); + + /// Represents a container on the Data Box Edge/Gateway device. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IContainer ContainerBody { get => this._containerBody; set => this._containerBody = value; } + + /// DataFormat for Container + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "DataFormat for Container")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"DataFormat for Container", + SerializedName = @"dataFormat", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat DataFormat { get => ContainerBody.DataFormat; set => ContainerBody.DataFormat = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The container name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The container name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The container name.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ContainerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _storageAccountName; + + /// The Storage Account Name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Storage Account Name")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Storage Account Name", + SerializedName = @"storageAccountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string StorageAccountName { get => this._storageAccountName; set => this._storageAccountName = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzDataBoxEdgeContainer_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.NewAzDataBoxEdgeContainer_CreateExpanded Clone() + { + var clone = new NewAzDataBoxEdgeContainer_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.ContainerBody = this.ContainerBody; + clone.DeviceName = this.DeviceName; + clone.StorageAccountName = this.StorageAccountName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 NewAzDataBoxEdgeContainer_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ContainersCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ContainersCreateOrUpdate(DeviceName, StorageAccountName, Name, SubscriptionId, ResourceGroupName, ContainerBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,StorageAccountName=StorageAccountName,Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,body=ContainerBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, StorageAccountName=StorageAccountName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, body=ContainerBody }) + { + 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, StorageAccountName=StorageAccountName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, body=ContainerBody }) + { + 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 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.DataBoxEdge.Models.Api20220301.IContainer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeDeviceCertificate_Generate.cs b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeDeviceCertificate_Generate.cs new file mode 100644 index 000000000000..77bfc9614215 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeDeviceCertificate_Generate.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Generates certificate for activation key. + /// + /// [OpenAPI] GenerateCertificate=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/generateCertificate" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataBoxEdgeDeviceCertificate_Generate", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Generates certificate for activation key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class NewAzDataBoxEdgeDeviceCertificate_Generate : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 NewAzDataBoxEdgeDeviceCertificate_Generate() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesGenerateCertificate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesGenerateCertificate(DeviceName, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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 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.DataBoxEdge.Models.Api20220301.IGenerateCertResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeDeviceCertificate_GenerateViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeDeviceCertificate_GenerateViaIdentity.cs new file mode 100644 index 000000000000..162addc31110 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeDeviceCertificate_GenerateViaIdentity.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Generates certificate for activation key. + /// + /// [OpenAPI] GenerateCertificate=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/generateCertificate" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataBoxEdgeDeviceCertificate_GenerateViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IGenerateCertResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Generates certificate for activation key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class NewAzDataBoxEdgeDeviceCertificate_GenerateViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 NewAzDataBoxEdgeDeviceCertificate_GenerateViaIdentity() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesGenerateCertificate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesGenerateCertificateViaIdentity(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) ); + } + await this.Client.DevicesGenerateCertificate(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IGenerateCertResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeDeviceSecuritySetting_CreateExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeDeviceSecuritySetting_CreateExpanded.cs new file mode 100644 index 000000000000..2e9bf3e14447 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeDeviceSecuritySetting_CreateExpanded.cs @@ -0,0 +1,517 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Updates the security settings on a Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] CreateOrUpdateSecuritySettings=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataBoxEdgeDeviceSecuritySetting_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Updates the security settings on a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class NewAzDataBoxEdgeDeviceSecuritySetting_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The algorithm used to encrypt "Value". + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The algorithm used to encrypt \"Value\".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm DeviceAdminPasswordEncryptionAlgorithm { get => SecuritySettingsBody.DeviceAdminPasswordEncryptionAlgorithm; set => SecuritySettingsBody.DeviceAdminPasswordEncryptionAlgorithm = value; } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Thumbprint certificate used to encrypt \\\"Value\\\". If the value is unencrypted, it will be null.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + public string DeviceAdminPasswordEncryptionCertThumbprint { get => SecuritySettingsBody.DeviceAdminPasswordEncryptionCertThumbprint ?? null; set => SecuritySettingsBody.DeviceAdminPasswordEncryptionCertThumbprint = value; } + + /// The value of the secret. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The value of the secret.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value of the secret.", + 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettings _securitySettingsBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SecuritySettings(); + + /// The security settings of a device. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettings SecuritySettingsBody { get => this._securitySettingsBody; set => this._securitySettingsBody = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzDataBoxEdgeDeviceSecuritySetting_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.NewAzDataBoxEdgeDeviceSecuritySetting_CreateExpanded Clone() + { + var clone = new NewAzDataBoxEdgeDeviceSecuritySetting_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; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 NewAzDataBoxEdgeDeviceSecuritySetting_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesCreateOrUpdateSecuritySettings(DeviceName, SubscriptionId, ResourceGroupName, SecuritySettingsBody, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,body=SecuritySettingsBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, 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, 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/databoxedge/generated/cmdlets/NewAzDataBoxEdgeDevice_CreateExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeDevice_CreateExpanded.cs new file mode 100644 index 000000000000..9618d03ff246 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeDevice_CreateExpanded.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Creates or updates a Data Box Edge/Data Box Gateway resource. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataBoxEdgeDevice_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Creates or updates a Data Box Edge/Data Box Gateway resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class NewAzDataBoxEdgeDevice_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice _dataBoxEdgeDeviceBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevice(); + + /// The Data Box Edge/Gateway device. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice DataBoxEdgeDeviceBody { get => this._dataBoxEdgeDeviceBody; set => this._dataBoxEdgeDeviceBody = value; } + + /// DataResidencyType enum + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "DataResidencyType enum")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DataResidencyType enum", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType DataResidencyType { get => DataBoxEdgeDeviceBody.DataResidencyType ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataResidencyType)""); set => DataBoxEdgeDeviceBody.DataResidencyType = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The etag for the devices. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The etag for the devices.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The etag for the devices.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => DataBoxEdgeDeviceBody.Etag ?? null; set => DataBoxEdgeDeviceBody.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Identity type + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identity type")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identity type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType IdentityType { get => DataBoxEdgeDeviceBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType)""); set => DataBoxEdgeDeviceBody.IdentityType = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// The location of the device. This is a supported and registered Azure geographical region (for example, West US, East US, + /// or Southeast Asia). The geographical region of a device cannot be changed once it is created, but if an identical geographical + /// region is specified on update, the request will succeed. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The location of the device. This is a supported and registered Azure geographical region (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed once it is created, but if an identical geographical region is specified on update, the request will succeed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The location of the device. This is a supported and registered Azure geographical region (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed once it is created, but if an identical geographical region is specified on update, the request will succeed.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => DataBoxEdgeDeviceBody.Location ?? null; set => DataBoxEdgeDeviceBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// SKU name. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "SKU name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SKU name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName SkuName { get => DataBoxEdgeDeviceBody.SkuName ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuName)""); set => DataBoxEdgeDeviceBody.SkuName = value; } + + /// The SKU tier. This is based on the SKU name. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The SKU tier. This is based on the SKU name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SKU tier. This is based on the SKU name.", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier SkuTier { get => DataBoxEdgeDeviceBody.SkuTier ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SkuTier)""); set => DataBoxEdgeDeviceBody.SkuTier = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// The list of tags that describe the device. These tags can be used to view and group this device (across resource groups). + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of tags that describe the device. These tags can be used to view and group this device (across resource groups).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of tags that describe the device. These tags can be used to view and group this device (across resource groups).", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceTags Tag { get => DataBoxEdgeDeviceBody.Tag ?? null /* object */; set => DataBoxEdgeDeviceBody.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 NewAzDataBoxEdgeDevice_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesCreateOrUpdate(Name, SubscriptionId, ResourceGroupName, DataBoxEdgeDeviceBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,body=DataBoxEdgeDeviceBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, body=DataBoxEdgeDeviceBody }) + { + 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, body=DataBoxEdgeDeviceBody }) + { + 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 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeMonitoringConfig_CreateExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeMonitoringConfig_CreateExpanded.cs new file mode 100644 index 000000000000..ce3b5eb93028 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeMonitoringConfig_CreateExpanded.cs @@ -0,0 +1,503 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Creates a new metric configuration or updates an existing one for a role. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataBoxEdgeMonitoringConfig_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Creates a new metric configuration or updates an existing one for a role.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class NewAzDataBoxEdgeMonitoringConfig_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 metrics configuration details + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The metrics configuration details")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The metrics configuration details", + SerializedName = @"metricConfigurations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMetricConfiguration[] MetricConfiguration { get => MonitoringMetricConfigurationBody.MetricConfiguration ?? null /* arrayOf */; set => MonitoringMetricConfigurationBody.MetricConfiguration = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration _monitoringMetricConfigurationBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.MonitoringMetricConfiguration(); + + /// The metric setting details for the role + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration MonitoringMetricConfigurationBody { get => this._monitoringMetricConfigurationBody; set => this._monitoringMetricConfigurationBody = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _roleName; + + /// The role name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The role name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The role name.", + SerializedName = @"roleName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string RoleName { get => this._roleName; set => this._roleName = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzDataBoxEdgeMonitoringConfig_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.NewAzDataBoxEdgeMonitoringConfig_CreateExpanded Clone() + { + var clone = new NewAzDataBoxEdgeMonitoringConfig_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.MonitoringMetricConfigurationBody = this.MonitoringMetricConfigurationBody; + clone.DeviceName = this.DeviceName; + clone.RoleName = this.RoleName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 NewAzDataBoxEdgeMonitoringConfig_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MonitoringConfigCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MonitoringConfigCreateOrUpdate(DeviceName, RoleName, SubscriptionId, ResourceGroupName, MonitoringMetricConfigurationBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,RoleName=RoleName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,body=MonitoringMetricConfigurationBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, RoleName=RoleName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, body=MonitoringMetricConfigurationBody }) + { + 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, RoleName=RoleName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, body=MonitoringMetricConfigurationBody }) + { + 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 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.DataBoxEdge.Models.Api20220301.IMonitoringMetricConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeOrder_CreateExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeOrder_CreateExpanded.cs new file mode 100644 index 000000000000..6fcbefcce0cb --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeOrder_CreateExpanded.cs @@ -0,0 +1,610 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Creates or updates an order. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataBoxEdgeOrder_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Creates or updates an order.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class NewAzDataBoxEdgeOrder_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.ClientAPI; + + /// The name of the company. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the company.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the company.", + SerializedName = @"companyName", + PossibleTypes = new [] { typeof(string) })] + public string ContactInformationCompanyName { get => OrderBody.ContactInformationCompanyName ?? null; set => OrderBody.ContactInformationCompanyName = value; } + + /// The contact person name. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The contact person name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The contact person name.", + SerializedName = @"contactPerson", + PossibleTypes = new [] { typeof(string) })] + public string ContactInformationContactPerson { get => OrderBody.ContactInformationContactPerson ?? null; set => OrderBody.ContactInformationContactPerson = value; } + + /// The email list. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The email list.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The email list.", + SerializedName = @"emailList", + PossibleTypes = new [] { typeof(string) })] + public string[] ContactInformationEmailList { get => OrderBody.ContactInformationEmailList ?? null /* arrayOf */; set => OrderBody.ContactInformationEmailList = value; } + + /// The phone number. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The phone number.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The phone number.", + SerializedName = @"phone", + PossibleTypes = new [] { typeof(string) })] + public string ContactInformationPhone { get => OrderBody.ContactInformationPhone ?? null; set => OrderBody.ContactInformationPhone = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The order details of a device. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The order details of a device.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The order details of a device.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder _orderBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Order(); + + /// The order details. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOrder OrderBody { get => this._orderBody; set => this._orderBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// ShipmentType of the order + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ShipmentType of the order")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ShipmentType of the order", + SerializedName = @"shipmentType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType ShipmentType { get => OrderBody.ShipmentType ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShipmentType)""); set => OrderBody.ShipmentType = value; } + + /// The city name. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The city name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The city name.", + SerializedName = @"city", + PossibleTypes = new [] { typeof(string) })] + public string ShippingAddressCity { get => OrderBody.ShippingAddressCity ?? null; set => OrderBody.ShippingAddressCity = value; } + + /// The country name. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The country name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The country name.", + SerializedName = @"country", + PossibleTypes = new [] { typeof(string) })] + public string ShippingAddressCountry { get => OrderBody.ShippingAddressCountry ?? null; set => OrderBody.ShippingAddressCountry = value; } + + /// The address line1. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The address line1.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The address line1.", + SerializedName = @"addressLine1", + PossibleTypes = new [] { typeof(string) })] + public string ShippingAddressLine1 { get => OrderBody.ShippingAddressLine1 ?? null; set => OrderBody.ShippingAddressLine1 = value; } + + /// The address line2. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The address line2.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The address line2.", + SerializedName = @"addressLine2", + PossibleTypes = new [] { typeof(string) })] + public string ShippingAddressLine2 { get => OrderBody.ShippingAddressLine2 ?? null; set => OrderBody.ShippingAddressLine2 = value; } + + /// The address line3. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The address line3.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The address line3.", + SerializedName = @"addressLine3", + PossibleTypes = new [] { typeof(string) })] + public string ShippingAddressLine3 { get => OrderBody.ShippingAddressLine3 ?? null; set => OrderBody.ShippingAddressLine3 = value; } + + /// The postal code. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The postal code.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The postal code.", + SerializedName = @"postalCode", + PossibleTypes = new [] { typeof(string) })] + public string ShippingAddressPostalCode { get => OrderBody.ShippingAddressPostalCode ?? null; set => OrderBody.ShippingAddressPostalCode = value; } + + /// The state name. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The state name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The state name.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(string) })] + public string ShippingAddressState { get => OrderBody.ShippingAddressState ?? null; set => OrderBody.ShippingAddressState = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzDataBoxEdgeOrder_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.NewAzDataBoxEdgeOrder_CreateExpanded Clone() + { + var clone = new NewAzDataBoxEdgeOrder_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.OrderBody = this.OrderBody; + clone.DeviceName = this.DeviceName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 NewAzDataBoxEdgeOrder_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'OrdersCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OrdersCreateOrUpdate(DeviceName, SubscriptionId, ResourceGroupName, OrderBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,body=OrderBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, body=OrderBody }) + { + 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, body=OrderBody }) + { + 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 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.DataBoxEdge.Models.Api20220301.IOrder + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeRole_CreateExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeRole_CreateExpanded.cs new file mode 100644 index 000000000000..dc1687c6bbdd --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeRole_CreateExpanded.cs @@ -0,0 +1,503 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Create or update a role. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataBoxEdgeRole_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Create or update a role.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class NewAzDataBoxEdgeRole_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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; } } + + /// Role type. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Role type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Role type.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.RoleTypes Kind { get => RoleBody.Kind; set => RoleBody.Kind = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The role name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The role name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The role name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole _roleBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Role(); + + /// Compute role. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IRole RoleBody { get => this._roleBody; set => this._roleBody = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzDataBoxEdgeRole_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.NewAzDataBoxEdgeRole_CreateExpanded Clone() + { + var clone = new NewAzDataBoxEdgeRole_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.RoleBody = this.RoleBody; + clone.DeviceName = this.DeviceName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 NewAzDataBoxEdgeRole_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RolesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RolesCreateOrUpdate(DeviceName, Name, SubscriptionId, ResourceGroupName, RoleBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,body=RoleBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, body=RoleBody }) + { + 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, body=RoleBody }) + { + 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 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.DataBoxEdge.Models.Api20220301.IRole + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeShare_CreateExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeShare_CreateExpanded.cs new file mode 100644 index 000000000000..9db869e0dd35 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeShare_CreateExpanded.cs @@ -0,0 +1,670 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Creates a new share or updates an existing share on the device. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataBoxEdgeShare_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Creates a new share or updates an existing share on the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class NewAzDataBoxEdgeShare_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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(); + + /// Access protocol to be used by the share. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Access protocol to be used by the share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Access protocol to be used by the share.", + SerializedName = @"accessProtocol", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareAccessProtocol AccessProtocol { get => ShareBody.AccessProtocol; set => ShareBody.AccessProtocol = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// + /// Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob).", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + public string AzureContainerInfoContainerName { get => ShareBody.AzureContainerInfoContainerName ?? null; set => ShareBody.AzureContainerInfoContainerName = value; } + + /// Storage format used for the file represented by the share. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Storage format used for the file represented by the share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage format used for the file represented by the share.", + SerializedName = @"dataFormat", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat AzureContainerInfoDataFormat { get => ShareBody.AzureContainerInfoDataFormat ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AzureContainerDataFormat)""); set => ShareBody.AzureContainerInfoDataFormat = value; } + + /// ID of the storage account credential used to access storage. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ID of the storage account credential used to access storage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of the storage account credential used to access storage.", + SerializedName = @"storageAccountCredentialId", + PossibleTypes = new [] { typeof(string) })] + public string AzureContainerInfoStorageAccountCredentialId { get => ShareBody.AzureContainerInfoStorageAccountCredentialId ?? null; set => ShareBody.AzureContainerInfoStorageAccountCredentialId = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.ClientAPI; + + /// + /// List of IP addresses and corresponding access rights on the share(required for NFS protocol). + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of IP addresses and corresponding access rights on the share(required for NFS protocol).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of IP addresses and corresponding access rights on the share(required for NFS protocol).", + SerializedName = @"clientAccessRights", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IClientAccessRight[] ClientAccessRights { get => ShareBody.ClientAccessRights ?? null /* arrayOf */; set => ShareBody.ClientAccessRights = value; } + + /// Data policy of the share. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Data policy of the share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data policy of the share.", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy DataPolicy { get => ShareBody.DataPolicy ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy)""); set => ShareBody.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Description for the share. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Description for the share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description for the share.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string Description { get => ShareBody.Description ?? null; set => ShareBody.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Current monitoring status of the share. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Current monitoring status of the share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Current monitoring status of the share.", + SerializedName = @"monitoringStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MonitoringStatus MonitoringStatus { get => ShareBody.MonitoringStatus; set => ShareBody.MonitoringStatus = value; } + + /// Backing field for property. + private string _name; + + /// The share name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The share name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The share name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This + /// could be a failed job or a successful job. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This could be a failed job or a successful job.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This could be a failed job or a successful job.", + SerializedName = @"errorManifestFile", + PossibleTypes = new [] { typeof(string) })] + public string RefreshDetailErrorManifestFile { get => ShareBody.RefreshDetailErrorManifestFile ?? null; set => ShareBody.RefreshDetailErrorManifestFile = value; } + + /// + /// If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that + /// job. The field is empty if no job is in progress. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that job. The field is empty if no job is in progress.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that job. The field is empty if no job is in progress.", + SerializedName = @"inProgressRefreshJobId", + PossibleTypes = new [] { typeof(string) })] + public string RefreshDetailInProgressRefreshJobId { get => ShareBody.RefreshDetailInProgressRefreshJobId ?? null; set => ShareBody.RefreshDetailInProgressRefreshJobId = value; } + + /// + /// Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed + /// job or a successful job. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed job or a successful job.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed job or a successful job.", + SerializedName = @"lastCompletedRefreshJobTimeInUTC", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime RefreshDetailLastCompletedRefreshJobTimeInUtc { get => ShareBody.RefreshDetailLastCompletedRefreshJobTimeInUtc ?? default(global::System.DateTime); set => ShareBody.RefreshDetailLastCompletedRefreshJobTimeInUtc = value; } + + /// + /// Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a + /// successful job. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a successful job.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a successful job.", + SerializedName = @"lastJob", + PossibleTypes = new [] { typeof(string) })] + public string RefreshDetailLastJob { get => ShareBody.RefreshDetailLastJob ?? null; set => ShareBody.RefreshDetailLastJob = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare _shareBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Share(); + + /// Represents a share on the Data Box Edge/Gateway device. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IShare ShareBody { get => this._shareBody; set => this._shareBody = value; } + + /// Current status of the share. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Current status of the share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Current status of the share.", + SerializedName = @"shareStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.ShareStatus ShareStatus { get => ShareBody.Status; set => ShareBody.Status = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// Mapping of users and corresponding access rights on the share (required for SMB protocol). + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Mapping of users and corresponding access rights on the share (required for SMB protocol).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mapping of users and corresponding access rights on the share (required for SMB protocol).", + SerializedName = @"userAccessRights", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUserAccessRight[] UserAccessRights { get => ShareBody.UserAccessRights ?? null /* arrayOf */; set => ShareBody.UserAccessRights = 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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzDataBoxEdgeShare_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.NewAzDataBoxEdgeShare_CreateExpanded Clone() + { + var clone = new NewAzDataBoxEdgeShare_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.ShareBody = this.ShareBody; + clone.DeviceName = this.DeviceName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 NewAzDataBoxEdgeShare_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SharesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SharesCreateOrUpdate(DeviceName, Name, SubscriptionId, ResourceGroupName, ShareBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,body=ShareBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, body=ShareBody }) + { + 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, body=ShareBody }) + { + 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 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.DataBoxEdge.Models.Api20220301.IShare + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeStorageAccountCredentials_CreateExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeStorageAccountCredentials_CreateExpanded.cs new file mode 100644 index 000000000000..d554f03e7253 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeStorageAccountCredentials_CreateExpanded.cs @@ -0,0 +1,610 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Creates or updates the storage account credential. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataBoxEdgeStorageAccountCredentials_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Creates or updates the storage account credential.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class NewAzDataBoxEdgeStorageAccountCredentials_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 algorithm used to encrypt "Value". + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The algorithm used to encrypt \"Value\".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm AccountKeyEncryptionAlgorithm { get => StorageAccountCredentialBody.AccountKeyEncryptionAlgorithm ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); set => StorageAccountCredentialBody.AccountKeyEncryptionAlgorithm = value; } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Thumbprint certificate used to encrypt \\\"Value\\\". If the value is unencrypted, it will be null.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + public string AccountKeyEncryptionCertThumbprint { get => StorageAccountCredentialBody.AccountKeyEncryptionCertThumbprint ?? null; set => StorageAccountCredentialBody.AccountKeyEncryptionCertThumbprint = value; } + + /// The value of the secret. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The value of the secret.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + public string AccountKeyValue { get => StorageAccountCredentialBody.AccountKeyValue ?? null; set => StorageAccountCredentialBody.AccountKeyValue = value; } + + /// Type of storage accessed on the storage account. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Type of storage accessed on the storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of storage accessed on the storage account.", + SerializedName = @"accountType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.AccountType AccountType { get => StorageAccountCredentialBody.AccountType; set => StorageAccountCredentialBody.AccountType = value; } + + /// Alias for the storage account. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Alias for the storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Alias for the storage account.", + SerializedName = @"alias", + PossibleTypes = new [] { typeof(string) })] + public string Alias { get => StorageAccountCredentialBody.Alias ?? null; set => StorageAccountCredentialBody.Alias = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Blob end point for private clouds. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Blob end point for private clouds.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Blob end point for private clouds.", + SerializedName = @"blobDomainName", + PossibleTypes = new [] { typeof(string) })] + public string BlobDomainName { get => StorageAccountCredentialBody.BlobDomainName ?? null; set => StorageAccountCredentialBody.BlobDomainName = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.ClientAPI; + + /// + /// Connection string for the storage account. Use this string if username and account key are not specified. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Connection string for the storage account. Use this string if username and account key are not specified.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Connection string for the storage account. Use this string if username and account key are not specified.", + SerializedName = @"connectionString", + PossibleTypes = new [] { typeof(string) })] + public string ConnectionString { get => StorageAccountCredentialBody.ConnectionString ?? null; set => StorageAccountCredentialBody.ConnectionString = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The storage account credential name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The storage account credential name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage account credential name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Signifies whether SSL needs to be enabled or not. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Signifies whether SSL needs to be enabled or not.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Signifies whether SSL needs to be enabled or not.", + SerializedName = @"sslStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.SslStatus SslStatus { get => StorageAccountCredentialBody.SslStatus; set => StorageAccountCredentialBody.SslStatus = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential _storageAccountCredentialBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccountCredential(); + + /// The storage account credential. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccountCredential StorageAccountCredentialBody { get => this._storageAccountCredentialBody; set => this._storageAccountCredentialBody = value; } + + /// Id of the storage account. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Id of the storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id of the storage account.", + SerializedName = @"storageAccountId", + PossibleTypes = new [] { typeof(string) })] + public string StorageAccountId { get => StorageAccountCredentialBody.StorageAccountId ?? null; set => StorageAccountCredentialBody.StorageAccountId = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Username for the storage account. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Username for the storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Username for the storage account.", + SerializedName = @"userName", + PossibleTypes = new [] { typeof(string) })] + public string UserName { get => StorageAccountCredentialBody.UserName ?? null; set => StorageAccountCredentialBody.UserName = 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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzDataBoxEdgeStorageAccountCredentials_CreateExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.NewAzDataBoxEdgeStorageAccountCredentials_CreateExpanded Clone() + { + var clone = new NewAzDataBoxEdgeStorageAccountCredentials_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.StorageAccountCredentialBody = this.StorageAccountCredentialBody; + clone.DeviceName = this.DeviceName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 NewAzDataBoxEdgeStorageAccountCredentials_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountCredentialsCreateOrUpdate(DeviceName, Name, SubscriptionId, ResourceGroupName, StorageAccountCredentialBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,body=StorageAccountCredentialBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, body=StorageAccountCredentialBody }) + { + 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, body=StorageAccountCredentialBody }) + { + 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 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.DataBoxEdge.Models.Api20220301.IStorageAccountCredential + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeStorageAccount_CreateExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeStorageAccount_CreateExpanded.cs new file mode 100644 index 000000000000..385e5c4efd34 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeStorageAccount_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// + /// Creates a new StorageAccount or updates an existing StorageAccount on the device. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataBoxEdgeStorageAccount_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Creates a new StorageAccount or updates an existing StorageAccount on the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class NewAzDataBoxEdgeStorageAccount_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.ClientAPI; + + /// Data policy of the storage Account. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Data policy of the storage Account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Data policy of the storage Account.", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.DataPolicy DataPolicy { get => StorageAccountBody.DataPolicy; set => StorageAccountBody.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Description for the storage Account. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Description for the storage Account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description for the storage Account.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string Description { get => StorageAccountBody.Description ?? null; set => StorageAccountBody.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The StorageAccount name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The StorageAccount name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The StorageAccount name.", + SerializedName = @"storageAccountName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("StorageAccountName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount _storageAccountBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.StorageAccount(); + + /// Represents a Storage Account on the Data Box Edge/Gateway device. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IStorageAccount StorageAccountBody { get => this._storageAccountBody; set => this._storageAccountBody = value; } + + /// Storage Account Credential Id + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Storage Account Credential Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage Account Credential Id", + SerializedName = @"storageAccountCredentialId", + PossibleTypes = new [] { typeof(string) })] + public string StorageAccountCredentialId { get => StorageAccountBody.CredentialId ?? null; set => StorageAccountBody.CredentialId = value; } + + /// Current status of the storage account + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Current status of the storage account")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Current status of the storage account", + SerializedName = @"storageAccountStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus StorageAccountStatus { get => StorageAccountBody.Status ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.StorageAccountStatus)""); set => StorageAccountBody.Status = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzDataBoxEdgeStorageAccount_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.NewAzDataBoxEdgeStorageAccount_CreateExpanded Clone() + { + var clone = new NewAzDataBoxEdgeStorageAccount_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.DeviceName = this.DeviceName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 NewAzDataBoxEdgeStorageAccount_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsCreateOrUpdate(DeviceName, Name, SubscriptionId, ResourceGroupName, StorageAccountBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,body=StorageAccountBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, 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 { DeviceName=DeviceName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, 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 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.DataBoxEdge.Models.Api20220301.IStorageAccount + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeTrigger_CreateExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeTrigger_CreateExpanded.cs new file mode 100644 index 000000000000..f5dfa8d62432 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeTrigger_CreateExpanded.cs @@ -0,0 +1,503 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Creates or updates a trigger. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataBoxEdgeTrigger_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Creates or updates a trigger.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class NewAzDataBoxEdgeTrigger_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// Creates or updates a trigger + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Creates or updates a trigger")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Creates or updates a trigger", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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; } } + + /// Trigger Kind. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Trigger Kind.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Trigger Kind.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.TriggerEventType Kind { get => TriggerBody.Kind; set => TriggerBody.Kind = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The trigger name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The trigger name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The trigger name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger _triggerBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.Trigger(); + + /// Trigger details. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITrigger TriggerBody { get => this._triggerBody; set => this._triggerBody = 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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzDataBoxEdgeTrigger_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.NewAzDataBoxEdgeTrigger_CreateExpanded Clone() + { + var clone = new NewAzDataBoxEdgeTrigger_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.TriggerBody = this.TriggerBody; + clone.DeviceName = this.DeviceName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 NewAzDataBoxEdgeTrigger_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TriggersCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TriggersCreateOrUpdate(DeviceName, Name, SubscriptionId, ResourceGroupName, TriggerBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,body=TriggerBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, body=TriggerBody }) + { + 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, body=TriggerBody }) + { + 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 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.DataBoxEdge.Models.Api20220301.ITrigger + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeUser_CreateExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeUser_CreateExpanded.cs new file mode 100644 index 000000000000..862cf8b0d77f --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/NewAzDataBoxEdgeUser_CreateExpanded.cs @@ -0,0 +1,543 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// + /// Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDataBoxEdgeUser_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class NewAzDataBoxEdgeUser_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// The algorithm used to encrypt "Value". + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The algorithm used to encrypt \"Value\".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm EncryptedPasswordEncryptionAlgorithm { get => UserBody.EncryptedPasswordEncryptionAlgorithm ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm)""); set => UserBody.EncryptedPasswordEncryptionAlgorithm = value; } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Thumbprint certificate used to encrypt \\\"Value\\\". If the value is unencrypted, it will be null.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + public string EncryptedPasswordEncryptionCertThumbprint { get => UserBody.EncryptedPasswordEncryptionCertThumbprint ?? null; set => UserBody.EncryptedPasswordEncryptionCertThumbprint = value; } + + /// The value of the secret. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The value of the secret.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + public string EncryptedPasswordValue { get => UserBody.EncryptedPasswordValue ?? null; set => UserBody.EncryptedPasswordValue = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The user name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The user name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The user name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser _userBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.User(); + + /// + /// Represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IUser UserBody { get => this._userBody; set => this._userBody = value; } + + /// Type of the user. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Type of the user.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of the user.", + SerializedName = @"userType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.UserType UserType { get => UserBody.UserType; set => UserBody.UserType = 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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzDataBoxEdgeUser_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.NewAzDataBoxEdgeUser_CreateExpanded Clone() + { + var clone = new NewAzDataBoxEdgeUser_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.UserBody = this.UserBody; + clone.DeviceName = this.DeviceName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 NewAzDataBoxEdgeUser_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'UsersCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.UsersCreateOrUpdate(DeviceName, Name, SubscriptionId, ResourceGroupName, UserBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,body=UserBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, body=UserBody }) + { + 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, body=UserBody }) + { + 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 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.DataBoxEdge.Models.Api20220301.IUser + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeAddon_Delete.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeAddon_Delete.cs new file mode 100644 index 000000000000..7f8eed84cd0d --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeAddon_Delete.cs @@ -0,0 +1,539 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the addon on the device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeAddon_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the addon on the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeAddon_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The addon name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The addon name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The addon name.", + SerializedName = @"addonName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AddonName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _roleName; + + /// The role name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The role name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The role name.", + SerializedName = @"roleName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string RoleName { get => this._roleName; set => this._roleName = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeAddon_Delete + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeAddon_Delete Clone() + { + var clone = new RemoveAzDataBoxEdgeAddon_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.RoleName = this.RoleName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AddonsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AddonsDelete(DeviceName, RoleName, Name, SubscriptionId, ResourceGroupName, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,RoleName=RoleName,Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeAddon_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, RoleName=RoleName, Name=Name, 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 { DeviceName=DeviceName, RoleName=RoleName, Name=Name, 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 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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeAddon_DeleteViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeAddon_DeleteViaIdentity.cs new file mode 100644 index 000000000000..c869302d67c3 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeAddon_DeleteViaIdentity.cs @@ -0,0 +1,495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the addon on the device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeAddon_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the addon on the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeAddon_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeAddon_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeAddon_DeleteViaIdentity Clone() + { + var clone = new RemoveAzDataBoxEdgeAddon_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AddonsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AddonsDeleteViaIdentity(InputObject.Id, onOk, 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.RoleName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RoleName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AddonName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AddonName"),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) ); + } + await this.Client.AddonsDelete(InputObject.DeviceName ?? null, InputObject.RoleName ?? null, InputObject.AddonName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeAddon_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeBandwidthSchedule_Delete.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeBandwidthSchedule_Delete.cs new file mode 100644 index 000000000000..9f5a9140cfcf --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeBandwidthSchedule_Delete.cs @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the specified bandwidth schedule. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeBandwidthSchedule_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the specified bandwidth schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeBandwidthSchedule_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The bandwidth schedule name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The bandwidth schedule name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The bandwidth schedule name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeBandwidthSchedule_Delete + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeBandwidthSchedule_Delete Clone() + { + var clone = new RemoveAzDataBoxEdgeBandwidthSchedule_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; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BandwidthSchedulesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BandwidthSchedulesDelete(DeviceName, Name, SubscriptionId, ResourceGroupName, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeBandwidthSchedule_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeBandwidthSchedule_DeleteViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeBandwidthSchedule_DeleteViaIdentity.cs new file mode 100644 index 000000000000..48fff7242874 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeBandwidthSchedule_DeleteViaIdentity.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the specified bandwidth schedule. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeBandwidthSchedule_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the specified bandwidth schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeBandwidthSchedule_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeBandwidthSchedule_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeBandwidthSchedule_DeleteViaIdentity Clone() + { + var clone = new RemoveAzDataBoxEdgeBandwidthSchedule_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BandwidthSchedulesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BandwidthSchedulesDeleteViaIdentity(InputObject.Id, onOk, 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.Name) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Name"),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) ); + } + await this.Client.BandwidthSchedulesDelete(InputObject.DeviceName ?? null, InputObject.Name ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeBandwidthSchedule_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeContainer_Delete.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeContainer_Delete.cs new file mode 100644 index 000000000000..2d001d5db8cf --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeContainer_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the container on the Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeContainer_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the container on the Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeContainer_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The container name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The container name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The container name.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ContainerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _storageAccountName; + + /// The Storage Account Name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Storage Account Name")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Storage Account Name", + SerializedName = @"storageAccountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string StorageAccountName { get => this._storageAccountName; set => this._storageAccountName = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeContainer_Delete + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeContainer_Delete Clone() + { + var clone = new RemoveAzDataBoxEdgeContainer_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.StorageAccountName = this.StorageAccountName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ContainersDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ContainersDelete(DeviceName, StorageAccountName, Name, SubscriptionId, ResourceGroupName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,StorageAccountName=StorageAccountName,Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeContainer_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, StorageAccountName=StorageAccountName, Name=Name, 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 { DeviceName=DeviceName, StorageAccountName=StorageAccountName, Name=Name, 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 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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeContainer_DeleteViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeContainer_DeleteViaIdentity.cs new file mode 100644 index 000000000000..dfce76b7f9b5 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeContainer_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the container on the Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeContainer_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the container on the Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeContainer_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeContainer_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeContainer_DeleteViaIdentity Clone() + { + var clone = new RemoveAzDataBoxEdgeContainer_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ContainersDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ContainersDeleteViaIdentity(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.StorageAccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.StorageAccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ContainerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ContainerName"),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) ); + } + await this.Client.ContainersDelete(InputObject.DeviceName ?? null, InputObject.StorageAccountName ?? null, InputObject.ContainerName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeContainer_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeDevice_Delete.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeDevice_Delete.cs new file mode 100644 index 000000000000..7f6f7bf34f86 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeDevice_Delete.cs @@ -0,0 +1,509 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeDevice_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeDevice_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeDevice_Delete + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeDevice_Delete Clone() + { + var clone = new RemoveAzDataBoxEdgeDevice_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; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesDelete(Name, SubscriptionId, ResourceGroupName, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeDevice_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeDevice_DeleteViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeDevice_DeleteViaIdentity.cs new file mode 100644 index 000000000000..80f8b55c3d77 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeDevice_DeleteViaIdentity.cs @@ -0,0 +1,487 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeDevice_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeDevice_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeDevice_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeDevice_DeleteViaIdentity Clone() + { + var clone = new RemoveAzDataBoxEdgeDevice_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesDeleteViaIdentity(InputObject.Id, onOk, 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) ); + } + await this.Client.DevicesDelete(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeDevice_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeMonitoringConfig_Delete.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeMonitoringConfig_Delete.cs new file mode 100644 index 000000000000..6734bf371082 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeMonitoringConfig_Delete.cs @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// deletes a new metric configuration for a role. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeMonitoringConfig_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"deletes a new metric configuration for a role.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeMonitoringConfig_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _roleName; + + /// The role name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The role name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The role name.", + SerializedName = @"roleName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string RoleName { get => this._roleName; set => this._roleName = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeMonitoringConfig_Delete + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeMonitoringConfig_Delete Clone() + { + var clone = new RemoveAzDataBoxEdgeMonitoringConfig_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.RoleName = this.RoleName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MonitoringConfigDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MonitoringConfigDelete(DeviceName, RoleName, SubscriptionId, ResourceGroupName, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,RoleName=RoleName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeMonitoringConfig_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, RoleName=RoleName, 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 { DeviceName=DeviceName, RoleName=RoleName, 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 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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeMonitoringConfig_DeleteViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeMonitoringConfig_DeleteViaIdentity.cs new file mode 100644 index 000000000000..5aa5e402a8fc --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeMonitoringConfig_DeleteViaIdentity.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// deletes a new metric configuration for a role. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeMonitoringConfig_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"deletes a new metric configuration for a role.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeMonitoringConfig_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeMonitoringConfig_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeMonitoringConfig_DeleteViaIdentity Clone() + { + var clone = new RemoveAzDataBoxEdgeMonitoringConfig_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MonitoringConfigDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.MonitoringConfigDeleteViaIdentity(InputObject.Id, onOk, 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.RoleName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RoleName"),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) ); + } + await this.Client.MonitoringConfigDelete(InputObject.DeviceName ?? null, InputObject.RoleName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeMonitoringConfig_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeOrder_Delete.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeOrder_Delete.cs new file mode 100644 index 000000000000..ca960c260204 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeOrder_Delete.cs @@ -0,0 +1,508 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the order related to the device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeOrder_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the order related to the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeOrder_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeOrder_Delete + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeOrder_Delete Clone() + { + var clone = new RemoveAzDataBoxEdgeOrder_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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'OrdersDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OrdersDelete(DeviceName, SubscriptionId, ResourceGroupName, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeOrder_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeOrder_DeleteViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeOrder_DeleteViaIdentity.cs new file mode 100644 index 000000000000..5b877f36d748 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeOrder_DeleteViaIdentity.cs @@ -0,0 +1,487 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the order related to the device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeOrder_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the order related to the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeOrder_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeOrder_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeOrder_DeleteViaIdentity Clone() + { + var clone = new RemoveAzDataBoxEdgeOrder_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'OrdersDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.OrdersDeleteViaIdentity(InputObject.Id, onOk, 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) ); + } + await this.Client.OrdersDelete(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeOrder_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeRole_Delete.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeRole_Delete.cs new file mode 100644 index 000000000000..0741753cd8bd --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeRole_Delete.cs @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the role on the device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeRole_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the role on the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeRole_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The role name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The role name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The role name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeRole_Delete + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeRole_Delete Clone() + { + var clone = new RemoveAzDataBoxEdgeRole_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; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RolesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RolesDelete(DeviceName, Name, SubscriptionId, ResourceGroupName, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeRole_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeRole_DeleteViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeRole_DeleteViaIdentity.cs new file mode 100644 index 000000000000..0e656a283315 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeRole_DeleteViaIdentity.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the role on the device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeRole_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the role on the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeRole_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeRole_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeRole_DeleteViaIdentity Clone() + { + var clone = new RemoveAzDataBoxEdgeRole_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RolesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.RolesDeleteViaIdentity(InputObject.Id, onOk, 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.Name) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Name"),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) ); + } + await this.Client.RolesDelete(InputObject.DeviceName ?? null, InputObject.Name ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeRole_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeShare_Delete.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeShare_Delete.cs new file mode 100644 index 000000000000..d3439da7bd1f --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeShare_Delete.cs @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the share on the Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeShare_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the share on the Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeShare_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The share name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The share name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The share name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeShare_Delete + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeShare_Delete Clone() + { + var clone = new RemoveAzDataBoxEdgeShare_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; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SharesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SharesDelete(DeviceName, Name, SubscriptionId, ResourceGroupName, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeShare_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeShare_DeleteViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeShare_DeleteViaIdentity.cs new file mode 100644 index 000000000000..e7175f85e659 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeShare_DeleteViaIdentity.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the share on the Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeShare_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the share on the Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeShare_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeShare_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeShare_DeleteViaIdentity Clone() + { + var clone = new RemoveAzDataBoxEdgeShare_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SharesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SharesDeleteViaIdentity(InputObject.Id, onOk, 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.Name) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Name"),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) ); + } + await this.Client.SharesDelete(InputObject.DeviceName ?? null, InputObject.Name ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeShare_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeStorageAccountCredentials_Delete.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeStorageAccountCredentials_Delete.cs new file mode 100644 index 000000000000..a8be393c971f --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeStorageAccountCredentials_Delete.cs @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the storage account credential. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeStorageAccountCredentials_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the storage account credential.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeStorageAccountCredentials_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The storage account credential name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The storage account credential name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage account credential name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeStorageAccountCredentials_Delete + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeStorageAccountCredentials_Delete Clone() + { + var clone = new RemoveAzDataBoxEdgeStorageAccountCredentials_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; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountCredentialsDelete(DeviceName, Name, SubscriptionId, ResourceGroupName, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeStorageAccountCredentials_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeStorageAccountCredentials_DeleteViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeStorageAccountCredentials_DeleteViaIdentity.cs new file mode 100644 index 000000000000..07edca67e085 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeStorageAccountCredentials_DeleteViaIdentity.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the storage account credential. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeStorageAccountCredentials_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the storage account credential.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeStorageAccountCredentials_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzDataBoxEdgeStorageAccountCredentials_DeleteViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeStorageAccountCredentials_DeleteViaIdentity Clone() + { + var clone = new RemoveAzDataBoxEdgeStorageAccountCredentials_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.StorageAccountCredentialsDeleteViaIdentity(InputObject.Id, onOk, 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.Name) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Name"),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) ); + } + await this.Client.StorageAccountCredentialsDelete(InputObject.DeviceName ?? null, InputObject.Name ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public RemoveAzDataBoxEdgeStorageAccountCredentials_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeStorageAccount_Delete.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeStorageAccount_Delete.cs new file mode 100644 index 000000000000..b615815d3b2c --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeStorageAccount_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeStorageAccount_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeStorageAccount_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The StorageAccount name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The StorageAccount name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The StorageAccount name.", + SerializedName = @"storageAccountName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("StorageAccountName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeStorageAccount_Delete + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeStorageAccount_Delete Clone() + { + var clone = new RemoveAzDataBoxEdgeStorageAccount_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; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsDelete(DeviceName, Name, SubscriptionId, ResourceGroupName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeStorageAccount_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeStorageAccount_DeleteViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeStorageAccount_DeleteViaIdentity.cs new file mode 100644 index 000000000000..83bd5d58c05e --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeStorageAccount_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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeStorageAccount_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeStorageAccount_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeStorageAccount_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeStorageAccount_DeleteViaIdentity Clone() + { + var clone = new RemoveAzDataBoxEdgeStorageAccount_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.StorageAccountsDeleteViaIdentity(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.StorageAccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.StorageAccountName"),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) ); + } + await this.Client.StorageAccountsDelete(InputObject.DeviceName ?? null, InputObject.StorageAccountName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeStorageAccount_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeTrigger_Delete.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeTrigger_Delete.cs new file mode 100644 index 000000000000..8ed286d8d5e1 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeTrigger_Delete.cs @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the trigger on the gateway device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeTrigger_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the trigger on the gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeTrigger_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The trigger name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The trigger name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The trigger name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeTrigger_Delete + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeTrigger_Delete Clone() + { + var clone = new RemoveAzDataBoxEdgeTrigger_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; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TriggersDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TriggersDelete(DeviceName, Name, SubscriptionId, ResourceGroupName, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeTrigger_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeTrigger_DeleteViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeTrigger_DeleteViaIdentity.cs new file mode 100644 index 000000000000..fd43149b6ba7 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeTrigger_DeleteViaIdentity.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the trigger on the gateway device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeTrigger_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the trigger on the gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeTrigger_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeTrigger_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeTrigger_DeleteViaIdentity Clone() + { + var clone = new RemoveAzDataBoxEdgeTrigger_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TriggersDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TriggersDeleteViaIdentity(InputObject.Id, onOk, 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.Name) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Name"),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) ); + } + await this.Client.TriggersDelete(InputObject.DeviceName ?? null, InputObject.Name ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeTrigger_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeUser_Delete.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeUser_Delete.cs new file mode 100644 index 000000000000..d476b3601225 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeUser_Delete.cs @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the user on a databox edge/gateway device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeUser_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the user on a databox edge/gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeUser_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The user name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The user name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The user name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeUser_Delete + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeUser_Delete Clone() + { + var clone = new RemoveAzDataBoxEdgeUser_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; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'UsersDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.UsersDelete(DeviceName, Name, SubscriptionId, ResourceGroupName, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeUser_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeUser_DeleteViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeUser_DeleteViaIdentity.cs new file mode 100644 index 000000000000..1cfbdab4dd98 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/RemoveAzDataBoxEdgeUser_DeleteViaIdentity.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Deletes the user on a databox edge/gateway device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzDataBoxEdgeUser_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Deletes the user on a databox edge/gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class RemoveAzDataBoxEdgeUser_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzDataBoxEdgeUser_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.RemoveAzDataBoxEdgeUser_DeleteViaIdentity Clone() + { + var clone = new RemoveAzDataBoxEdgeUser_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'UsersDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.UsersDeleteViaIdentity(InputObject.Id, onOk, 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.Name) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Name"),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) ); + } + await this.Client.UsersDelete(InputObject.DeviceName ?? null, InputObject.Name ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzDataBoxEdgeUser_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/cmdlets/StartAzDataBoxEdgeSupportPackage_Trigger.cs b/swaggerci/databoxedge/generated/cmdlets/StartAzDataBoxEdgeSupportPackage_Trigger.cs new file mode 100644 index 000000000000..d7c669a2f6c7 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/StartAzDataBoxEdgeSupportPackage_Trigger.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Triggers support package on the device + /// + /// [OpenAPI] TriggerSupportPackage=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggerSupportPackage" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Start, @"AzDataBoxEdgeSupportPackage_Trigger", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Triggers support package on the device")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class StartAzDataBoxEdgeSupportPackage_Trigger : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest _triggerSupportPackageRequest; + + /// The request object for trigger support package. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The request object for trigger support package.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The request object for trigger support package.", + SerializedName = @"triggerSupportPackageRequest", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest TriggerSupportPackageRequest { get => this._triggerSupportPackageRequest; set => this._triggerSupportPackageRequest = 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of StartAzDataBoxEdgeSupportPackage_Trigger + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.StartAzDataBoxEdgeSupportPackage_Trigger Clone() + { + var clone = new StartAzDataBoxEdgeSupportPackage_Trigger(); + 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.TriggerSupportPackageRequest = this.TriggerSupportPackageRequest; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SupportPackagesTriggerSupportPackage' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SupportPackagesTriggerSupportPackage(DeviceName, SubscriptionId, ResourceGroupName, TriggerSupportPackageRequest, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,body=TriggerSupportPackageRequest}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StartAzDataBoxEdgeSupportPackage_Trigger() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, body=TriggerSupportPackageRequest }) + { + 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, body=TriggerSupportPackageRequest }) + { + 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/databoxedge/generated/cmdlets/StartAzDataBoxEdgeSupportPackage_TriggerExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/StartAzDataBoxEdgeSupportPackage_TriggerExpanded.cs new file mode 100644 index 000000000000..051d1e917cd7 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/StartAzDataBoxEdgeSupportPackage_TriggerExpanded.cs @@ -0,0 +1,517 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Triggers support package on the device + /// + /// [OpenAPI] TriggerSupportPackage=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggerSupportPackage" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Start, @"AzDataBoxEdgeSupportPackage_TriggerExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Triggers support package on the device")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class StartAzDataBoxEdgeSupportPackage_TriggerExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// + /// Type of files, which need to be included in the logsThis will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived)or + /// a comma separated list of log types that are required + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of files, which need to be included in the logsThis will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived)or a comma separated list of log types that are required")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of files, which need to be included in the logsThis will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived)or a comma separated list of log types that are required", + SerializedName = @"include", + PossibleTypes = new [] { typeof(string) })] + public string Include { get => TriggerSupportPackageRequestBody.Include ?? null; set => TriggerSupportPackageRequestBody.Include = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Start of the timespan of the log collection + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Start of the timespan of the log collection")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start of the timespan of the log collection", + SerializedName = @"maximumTimeStamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime MaximumTimeStamp { get => TriggerSupportPackageRequestBody.MaximumTimeStamp ?? default(global::System.DateTime); set => TriggerSupportPackageRequestBody.MaximumTimeStamp = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// MinimumTimeStamp from where logs need to be collected + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "MinimumTimeStamp from where logs need to be collected")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"MinimumTimeStamp from where logs need to be collected", + SerializedName = @"minimumTimeStamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime MinimumTimeStamp { get => TriggerSupportPackageRequestBody.MinimumTimeStamp ?? default(global::System.DateTime); set => TriggerSupportPackageRequestBody.MinimumTimeStamp = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest _triggerSupportPackageRequestBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TriggerSupportPackageRequest(); + + /// The request object for trigger support package. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest TriggerSupportPackageRequestBody { get => this._triggerSupportPackageRequestBody; set => this._triggerSupportPackageRequestBody = 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of StartAzDataBoxEdgeSupportPackage_TriggerExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.StartAzDataBoxEdgeSupportPackage_TriggerExpanded Clone() + { + var clone = new StartAzDataBoxEdgeSupportPackage_TriggerExpanded(); + 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.TriggerSupportPackageRequestBody = this.TriggerSupportPackageRequestBody; + clone.DeviceName = this.DeviceName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SupportPackagesTriggerSupportPackage' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SupportPackagesTriggerSupportPackage(DeviceName, SubscriptionId, ResourceGroupName, TriggerSupportPackageRequestBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,body=TriggerSupportPackageRequestBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StartAzDataBoxEdgeSupportPackage_TriggerExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, body=TriggerSupportPackageRequestBody }) + { + 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, body=TriggerSupportPackageRequestBody }) + { + 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/databoxedge/generated/cmdlets/StartAzDataBoxEdgeSupportPackage_TriggerViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/StartAzDataBoxEdgeSupportPackage_TriggerViaIdentity.cs new file mode 100644 index 000000000000..da410a78e7d1 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/StartAzDataBoxEdgeSupportPackage_TriggerViaIdentity.cs @@ -0,0 +1,467 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Triggers support package on the device + /// + /// [OpenAPI] TriggerSupportPackage=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggerSupportPackage" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Start, @"AzDataBoxEdgeSupportPackage_TriggerViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Triggers support package on the device")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class StartAzDataBoxEdgeSupportPackage_TriggerViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest _triggerSupportPackageRequest; + + /// The request object for trigger support package. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The request object for trigger support package.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The request object for trigger support package.", + SerializedName = @"triggerSupportPackageRequest", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest TriggerSupportPackageRequest { get => this._triggerSupportPackageRequest; set => this._triggerSupportPackageRequest = 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of StartAzDataBoxEdgeSupportPackage_TriggerViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.StartAzDataBoxEdgeSupportPackage_TriggerViaIdentity Clone() + { + var clone = new StartAzDataBoxEdgeSupportPackage_TriggerViaIdentity(); + 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.TriggerSupportPackageRequest = this.TriggerSupportPackageRequest; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SupportPackagesTriggerSupportPackage' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SupportPackagesTriggerSupportPackageViaIdentity(InputObject.Id, TriggerSupportPackageRequest, 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) ); + } + await this.Client.SupportPackagesTriggerSupportPackage(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, TriggerSupportPackageRequest, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=TriggerSupportPackageRequest}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StartAzDataBoxEdgeSupportPackage_TriggerViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=TriggerSupportPackageRequest }) + { + 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=TriggerSupportPackageRequest }) + { + 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/databoxedge/generated/cmdlets/StartAzDataBoxEdgeSupportPackage_TriggerViaIdentityExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/StartAzDataBoxEdgeSupportPackage_TriggerViaIdentityExpanded.cs new file mode 100644 index 000000000000..5cbcb654b545 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/StartAzDataBoxEdgeSupportPackage_TriggerViaIdentityExpanded.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Triggers support package on the device + /// + /// [OpenAPI] TriggerSupportPackage=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggerSupportPackage" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Start, @"AzDataBoxEdgeSupportPackage_TriggerViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Triggers support package on the device")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class StartAzDataBoxEdgeSupportPackage_TriggerViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// + /// Type of files, which need to be included in the logsThis will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived)or + /// a comma separated list of log types that are required + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of files, which need to be included in the logsThis will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived)or a comma separated list of log types that are required")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of files, which need to be included in the logsThis will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived)or a comma separated list of log types that are required", + SerializedName = @"include", + PossibleTypes = new [] { typeof(string) })] + public string Include { get => TriggerSupportPackageRequestBody.Include ?? null; set => TriggerSupportPackageRequestBody.Include = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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; } } + + /// Start of the timespan of the log collection + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Start of the timespan of the log collection")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start of the timespan of the log collection", + SerializedName = @"maximumTimeStamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime MaximumTimeStamp { get => TriggerSupportPackageRequestBody.MaximumTimeStamp ?? default(global::System.DateTime); set => TriggerSupportPackageRequestBody.MaximumTimeStamp = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// MinimumTimeStamp from where logs need to be collected + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "MinimumTimeStamp from where logs need to be collected")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"MinimumTimeStamp from where logs need to be collected", + SerializedName = @"minimumTimeStamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime MinimumTimeStamp { get => TriggerSupportPackageRequestBody.MinimumTimeStamp ?? default(global::System.DateTime); set => TriggerSupportPackageRequestBody.MinimumTimeStamp = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest _triggerSupportPackageRequestBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.TriggerSupportPackageRequest(); + + /// The request object for trigger support package. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ITriggerSupportPackageRequest TriggerSupportPackageRequestBody { get => this._triggerSupportPackageRequestBody; set => this._triggerSupportPackageRequestBody = 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of StartAzDataBoxEdgeSupportPackage_TriggerViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.StartAzDataBoxEdgeSupportPackage_TriggerViaIdentityExpanded Clone() + { + var clone = new StartAzDataBoxEdgeSupportPackage_TriggerViaIdentityExpanded(); + 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.TriggerSupportPackageRequestBody = this.TriggerSupportPackageRequestBody; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SupportPackagesTriggerSupportPackage' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SupportPackagesTriggerSupportPackageViaIdentity(InputObject.Id, TriggerSupportPackageRequestBody, 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) ); + } + await this.Client.SupportPackagesTriggerSupportPackage(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, TriggerSupportPackageRequestBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=TriggerSupportPackageRequestBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StartAzDataBoxEdgeSupportPackage_TriggerViaIdentityExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=TriggerSupportPackageRequestBody }) + { + 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=TriggerSupportPackageRequestBody }) + { + 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/databoxedge/generated/cmdlets/TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_Check.cs b/swaggerci/databoxedge/generated/cmdlets/TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_Check.cs new file mode 100644 index 000000000000..af784a44334d --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_Check.cs @@ -0,0 +1,506 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Posts the device capacity request info to check feasibility. + /// + /// [OpenAPI] CheckResourceCreationFeasibility=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/deviceCapacityCheck" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_Check", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Posts the device capacity request info to check feasibility.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_Check : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Backing field for property. + private string _capacityName; + + /// The capacity name. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The capacity name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The capacity name.", + SerializedName = @"capacityName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Query)] + public string CapacityName { get => this._capacityName; set => this._capacityName = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo _deviceCapacityRequestInfo; + + /// Object for Capturing DeviceCapacityRequestInfo + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Object for Capturing DeviceCapacityRequestInfo", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Object for Capturing DeviceCapacityRequestInfo", + SerializedName = @"deviceCapacityRequestInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo DeviceCapacityRequestInfo { get => this._deviceCapacityRequestInfo; set => this._deviceCapacityRequestInfo = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_Check + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_Check Clone() + { + var clone = new TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_Check(); + 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.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.DeviceName = this.DeviceName; + clone.CapacityName = this.CapacityName; + clone.DeviceCapacityRequestInfo = this.DeviceCapacityRequestInfo; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DeviceCapacityCheckResourceCreationFeasibility' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DeviceCapacityCheckResourceCreationFeasibility(SubscriptionId, ResourceGroupName, DeviceName, this.InvocationInformation.BoundParameters.ContainsKey("CapacityName") ? CapacityName : null, DeviceCapacityRequestInfo, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,DeviceName=DeviceName,CapacityName=this.InvocationInformation.BoundParameters.ContainsKey("CapacityName") ? CapacityName : null,body=DeviceCapacityRequestInfo}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the + /// cmdlet class. + /// + public TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_Check() + { + + } + + /// + /// 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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, DeviceName=DeviceName, CapacityName=this.InvocationInformation.BoundParameters.ContainsKey("CapacityName") ? CapacityName : null, body=DeviceCapacityRequestInfo }) + { + 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, DeviceName=DeviceName, CapacityName=this.InvocationInformation.BoundParameters.ContainsKey("CapacityName") ? CapacityName : null, body=DeviceCapacityRequestInfo }) + { + 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/databoxedge/generated/cmdlets/TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckExpanded.cs new file mode 100644 index 000000000000..0fca39c2ec7d --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckExpanded.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Posts the device capacity request info to check feasibility. + /// + /// [OpenAPI] CheckResourceCreationFeasibility=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/deviceCapacityCheck" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Posts the device capacity request info to check feasibility.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Backing field for property. + private string _capacityName; + + /// The capacity name. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The capacity name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The capacity name.", + SerializedName = @"capacityName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Query)] + public string CapacityName { get => this._capacityName; set => this._capacityName = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo _deviceCapacityRequestInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityRequestInfo(); + + /// Object for Capturing DeviceCapacityRequestInfo + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo DeviceCapacityRequestInfoBody { get => this._deviceCapacityRequestInfoBody; set => this._deviceCapacityRequestInfoBody = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// Array containing the sizes of the VMs for checking if its feasible to create them on the appliance. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Array containing the sizes of the VMs for checking if its feasible to create them on the appliance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Array containing the sizes of the VMs for checking if its feasible to create them on the appliance.", + SerializedName = @"vmPlacementQuery", + PossibleTypes = new [] { typeof(string) })] + public string[][] VMPlacementQuery { get => DeviceCapacityRequestInfoBody.VMPlacementQuery ?? null /* arrayOf */; set => DeviceCapacityRequestInfoBody.VMPlacementQuery = value; } + + /// Array of the VMs of the sizes in VmSizes can be provisioned on the appliance. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of the VMs of the sizes in VmSizes can be provisioned on the appliance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of the VMs of the sizes in VmSizes can be provisioned on the appliance.", + SerializedName = @"vmPlacementResults", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult[] VMPlacementResult { get => DeviceCapacityRequestInfoBody.VMPlacementResult ?? null /* arrayOf */; set => DeviceCapacityRequestInfoBody.VMPlacementResult = 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckExpanded Clone() + { + var clone = new TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckExpanded(); + 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.DeviceCapacityRequestInfoBody = this.DeviceCapacityRequestInfoBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.DeviceName = this.DeviceName; + clone.CapacityName = this.CapacityName; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DeviceCapacityCheckResourceCreationFeasibility' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DeviceCapacityCheckResourceCreationFeasibility(SubscriptionId, ResourceGroupName, DeviceName, this.InvocationInformation.BoundParameters.ContainsKey("CapacityName") ? CapacityName : null, DeviceCapacityRequestInfoBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,DeviceName=DeviceName,CapacityName=this.InvocationInformation.BoundParameters.ContainsKey("CapacityName") ? CapacityName : null,body=DeviceCapacityRequestInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckExpanded() + { + + } + + /// + /// 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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, DeviceName=DeviceName, CapacityName=this.InvocationInformation.BoundParameters.ContainsKey("CapacityName") ? CapacityName : null, body=DeviceCapacityRequestInfoBody }) + { + 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, DeviceName=DeviceName, CapacityName=this.InvocationInformation.BoundParameters.ContainsKey("CapacityName") ? CapacityName : null, body=DeviceCapacityRequestInfoBody }) + { + 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/databoxedge/generated/cmdlets/TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentity.cs new file mode 100644 index 000000000000..c42384d850cb --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentity.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Posts the device capacity request info to check feasibility. + /// + /// [OpenAPI] CheckResourceCreationFeasibility=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/deviceCapacityCheck" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Posts the device capacity request info to check feasibility.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Backing field for property. + private string _capacityName; + + /// The capacity name. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The capacity name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The capacity name.", + SerializedName = @"capacityName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Query)] + public string CapacityName { get => this._capacityName; set => this._capacityName = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo _deviceCapacityRequestInfo; + + /// Object for Capturing DeviceCapacityRequestInfo + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Object for Capturing DeviceCapacityRequestInfo", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Object for Capturing DeviceCapacityRequestInfo", + SerializedName = @"deviceCapacityRequestInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo DeviceCapacityRequestInfo { get => this._deviceCapacityRequestInfo; set => this._deviceCapacityRequestInfo = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentity Clone() + { + var clone = new TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentity(); + 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.CapacityName = this.CapacityName; + clone.DeviceCapacityRequestInfo = this.DeviceCapacityRequestInfo; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DeviceCapacityCheckResourceCreationFeasibility' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DeviceCapacityCheckResourceCreationFeasibilityViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("CapacityName") ? CapacityName : null, DeviceCapacityRequestInfo, 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.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) ); + } + await this.Client.DeviceCapacityCheckResourceCreationFeasibility(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DeviceName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("CapacityName") ? CapacityName : null, DeviceCapacityRequestInfo, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CapacityName=this.InvocationInformation.BoundParameters.ContainsKey("CapacityName") ? CapacityName : null,body=DeviceCapacityRequestInfo}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentity() + { + + } + + /// + /// 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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CapacityName=this.InvocationInformation.BoundParameters.ContainsKey("CapacityName") ? CapacityName : null, body=DeviceCapacityRequestInfo }) + { + 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 { CapacityName=this.InvocationInformation.BoundParameters.ContainsKey("CapacityName") ? CapacityName : null, body=DeviceCapacityRequestInfo }) + { + 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/databoxedge/generated/cmdlets/TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentityExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentityExpanded.cs new file mode 100644 index 000000000000..6ec885aa5396 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentityExpanded.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Posts the device capacity request info to check feasibility. + /// + /// [OpenAPI] CheckResourceCreationFeasibility=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/deviceCapacityCheck" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Posts the device capacity request info to check feasibility.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Backing field for property. + private string _capacityName; + + /// The capacity name. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The capacity name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The capacity name.", + SerializedName = @"capacityName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Query)] + public string CapacityName { get => this._capacityName; set => this._capacityName = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo _deviceCapacityRequestInfoBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DeviceCapacityRequestInfo(); + + /// Object for Capturing DeviceCapacityRequestInfo + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDeviceCapacityRequestInfo DeviceCapacityRequestInfoBody { get => this._deviceCapacityRequestInfoBody; set => this._deviceCapacityRequestInfoBody = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// Array containing the sizes of the VMs for checking if its feasible to create them on the appliance. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Array containing the sizes of the VMs for checking if its feasible to create them on the appliance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Array containing the sizes of the VMs for checking if its feasible to create them on the appliance.", + SerializedName = @"vmPlacementQuery", + PossibleTypes = new [] { typeof(string) })] + public string[][] VMPlacementQuery { get => DeviceCapacityRequestInfoBody.VMPlacementQuery ?? null /* arrayOf */; set => DeviceCapacityRequestInfoBody.VMPlacementQuery = value; } + + /// Array of the VMs of the sizes in VmSizes can be provisioned on the appliance. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of the VMs of the sizes in VmSizes can be provisioned on the appliance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of the VMs of the sizes in VmSizes can be provisioned on the appliance.", + SerializedName = @"vmPlacementResults", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IVMPlacementRequestResult[] VMPlacementResult { get => DeviceCapacityRequestInfoBody.VMPlacementResult ?? null /* arrayOf */; set => DeviceCapacityRequestInfoBody.VMPlacementResult = 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentityExpanded Clone() + { + var clone = new TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentityExpanded(); + 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.DeviceCapacityRequestInfoBody = this.DeviceCapacityRequestInfoBody; + clone.CapacityName = this.CapacityName; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DeviceCapacityCheckResourceCreationFeasibility' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DeviceCapacityCheckResourceCreationFeasibilityViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("CapacityName") ? CapacityName : null, DeviceCapacityRequestInfoBody, 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.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) ); + } + await this.Client.DeviceCapacityCheckResourceCreationFeasibility(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.DeviceName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("CapacityName") ? CapacityName : null, DeviceCapacityRequestInfoBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CapacityName=this.InvocationInformation.BoundParameters.ContainsKey("CapacityName") ? CapacityName : null,body=DeviceCapacityRequestInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public TestAzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility_CheckViaIdentityExpanded() + { + + } + + /// + /// 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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CapacityName=this.InvocationInformation.BoundParameters.ContainsKey("CapacityName") ? CapacityName : null, body=DeviceCapacityRequestInfoBody }) + { + 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 { CapacityName=this.InvocationInformation.BoundParameters.ContainsKey("CapacityName") ? CapacityName : null, body=DeviceCapacityRequestInfoBody }) + { + 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/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeContainer_Refresh.cs b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeContainer_Refresh.cs new file mode 100644 index 000000000000..9e0dd2d5f658 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeContainer_Refresh.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Refreshes the container metadata with the data from the cloud. + /// + /// [OpenAPI] Refresh=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}/refresh" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataBoxEdgeContainer_Refresh", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Refreshes the container metadata with the data from the cloud.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class UpdateAzDataBoxEdgeContainer_Refresh : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The container name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The container name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The container name.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ContainerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _storageAccountName; + + /// The Storage Account Name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Storage Account Name")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Storage Account Name", + SerializedName = @"storageAccountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string StorageAccountName { get => this._storageAccountName; set => this._storageAccountName = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzDataBoxEdgeContainer_Refresh + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.UpdateAzDataBoxEdgeContainer_Refresh Clone() + { + var clone = new UpdateAzDataBoxEdgeContainer_Refresh(); + 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.StorageAccountName = this.StorageAccountName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ContainersRefresh' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ContainersRefresh(DeviceName, StorageAccountName, Name, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,StorageAccountName=StorageAccountName,Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzDataBoxEdgeContainer_Refresh() + { + + } + + /// + /// 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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, StorageAccountName=StorageAccountName, Name=Name, 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 { DeviceName=DeviceName, StorageAccountName=StorageAccountName, Name=Name, 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. + /// + /// 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/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeContainer_RefreshViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeContainer_RefreshViaIdentity.cs new file mode 100644 index 000000000000..d7ffcb11b6a5 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeContainer_RefreshViaIdentity.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Refreshes the container metadata with the data from the cloud. + /// + /// [OpenAPI] Refresh=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}/refresh" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataBoxEdgeContainer_RefreshViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Refreshes the container metadata with the data from the cloud.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class UpdateAzDataBoxEdgeContainer_RefreshViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzDataBoxEdgeContainer_RefreshViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.UpdateAzDataBoxEdgeContainer_RefreshViaIdentity Clone() + { + var clone = new UpdateAzDataBoxEdgeContainer_RefreshViaIdentity(); + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ContainersRefresh' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ContainersRefreshViaIdentity(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.StorageAccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.StorageAccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ContainerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ContainerName"),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) ); + } + await this.Client.ContainersRefresh(InputObject.DeviceName ?? null, InputObject.StorageAccountName ?? null, InputObject.ContainerName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzDataBoxEdgeContainer_RefreshViaIdentity() + { + + } + + /// + /// 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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// + /// 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/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeDeviceExtendedInformation_UpdateExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeDeviceExtendedInformation_UpdateExpanded.cs new file mode 100644 index 000000000000..389f9c62f55a --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeDeviceExtendedInformation_UpdateExpanded.cs @@ -0,0 +1,470 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// + /// Gets additional information for the specified Data Box Edge/Data Box Gateway device. + /// + /// + /// [OpenAPI] UpdateExtendedInformation=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateExtendedInformation" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataBoxEdgeDeviceExtendedInformation_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets additional information for the specified Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class UpdateAzDataBoxEdgeDeviceExtendedInformation_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The name for Channel Integrity Key stored in the Client Key Vault + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name for Channel Integrity Key stored in the Client Key Vault")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name for Channel Integrity Key stored in the Client Key Vault", + SerializedName = @"channelIntegrityKeyName", + PossibleTypes = new [] { typeof(string) })] + public string ChannelIntegrityKeyName { get => ParametersBody.ChannelIntegrityKeyName ?? null; set => ParametersBody.ChannelIntegrityKeyName = value; } + + /// The version of Channel Integrity Key stored in the Client Key Vault + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The version of Channel Integrity Key stored in the Client Key Vault")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The version of Channel Integrity Key stored in the Client Key Vault", + SerializedName = @"channelIntegrityKeyVersion", + PossibleTypes = new [] { typeof(string) })] + public string ChannelIntegrityKeyVersion { get => ParametersBody.ChannelIntegrityKeyVersion ?? null; set => ParametersBody.ChannelIntegrityKeyVersion = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.ClientAPI; + + /// The Key Vault ARM Id for client secrets + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Key Vault ARM Id for client secrets")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Key Vault ARM Id for client secrets", + SerializedName = @"clientSecretStoreId", + PossibleTypes = new [] { typeof(string) })] + public string ClientSecretStoreId { get => ParametersBody.ClientSecretStoreId ?? null; set => ParametersBody.ClientSecretStoreId = value; } + + /// The url to access the Client Key Vault + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The url to access the Client Key Vault")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The url to access the Client Key Vault", + SerializedName = @"clientSecretStoreUrl", + PossibleTypes = new [] { typeof(string) })] + public string ClientSecretStoreUrl { get => ParametersBody.ClientSecretStoreUrl ?? null; set => ParametersBody.ClientSecretStoreUrl = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatch _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfoPatch(); + + /// The Data Box Edge/Gateway device extended info patch. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatch ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status will not + /// be applicable. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status will not be applicable.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status will not be applicable.", + SerializedName = @"syncStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus SyncStatus { get => ParametersBody.SyncStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus)""); set => ParametersBody.SyncStatus = 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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesUpdateExtendedInformation' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesUpdateExtendedInformation(DeviceName, SubscriptionId, ResourceGroupName, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzDataBoxEdgeDeviceExtendedInformation_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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, 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 { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, 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 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeDeviceExtendedInformation_UpdateViaIdentityExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeDeviceExtendedInformation_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..f70a17691fc4 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeDeviceExtendedInformation_UpdateViaIdentityExpanded.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// + /// Gets additional information for the specified Data Box Edge/Data Box Gateway device. + /// + /// + /// [OpenAPI] UpdateExtendedInformation=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateExtendedInformation" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataBoxEdgeDeviceExtendedInformation_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Gets additional information for the specified Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class UpdateAzDataBoxEdgeDeviceExtendedInformation_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The name for Channel Integrity Key stored in the Client Key Vault + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name for Channel Integrity Key stored in the Client Key Vault")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name for Channel Integrity Key stored in the Client Key Vault", + SerializedName = @"channelIntegrityKeyName", + PossibleTypes = new [] { typeof(string) })] + public string ChannelIntegrityKeyName { get => ParametersBody.ChannelIntegrityKeyName ?? null; set => ParametersBody.ChannelIntegrityKeyName = value; } + + /// The version of Channel Integrity Key stored in the Client Key Vault + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The version of Channel Integrity Key stored in the Client Key Vault")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The version of Channel Integrity Key stored in the Client Key Vault", + SerializedName = @"channelIntegrityKeyVersion", + PossibleTypes = new [] { typeof(string) })] + public string ChannelIntegrityKeyVersion { get => ParametersBody.ChannelIntegrityKeyVersion ?? null; set => ParametersBody.ChannelIntegrityKeyVersion = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.ClientAPI; + + /// The Key Vault ARM Id for client secrets + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Key Vault ARM Id for client secrets")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Key Vault ARM Id for client secrets", + SerializedName = @"clientSecretStoreId", + PossibleTypes = new [] { typeof(string) })] + public string ClientSecretStoreId { get => ParametersBody.ClientSecretStoreId ?? null; set => ParametersBody.ClientSecretStoreId = value; } + + /// The url to access the Client Key Vault + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The url to access the Client Key Vault")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The url to access the Client Key Vault", + SerializedName = @"clientSecretStoreUrl", + PossibleTypes = new [] { typeof(string) })] + public string ClientSecretStoreUrl { get => ParametersBody.ClientSecretStoreUrl ?? null; set => ParametersBody.ClientSecretStoreUrl = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatch _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDeviceExtendedInfoPatch(); + + /// The Data Box Edge/Gateway device extended info patch. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfoPatch ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status will not + /// be applicable. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status will not be applicable.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status will not be applicable.", + SerializedName = @"syncStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus SyncStatus { get => ParametersBody.SyncStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.KeyVaultSyncStatus)""); set => ParametersBody.SyncStatus = 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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesUpdateExtendedInformation' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesUpdateExtendedInformationViaIdentity(InputObject.Id, ParametersBody, 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) ); + } + await this.Client.DevicesUpdateExtendedInformation(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, ParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the + /// cmdlet class. + /// + public UpdateAzDataBoxEdgeDeviceExtendedInformation_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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDeviceExtendedInfo + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeDeviceSecuritySetting_UpdateExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeDeviceSecuritySetting_UpdateExpanded.cs new file mode 100644 index 000000000000..d18bad3c90af --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeDeviceSecuritySetting_UpdateExpanded.cs @@ -0,0 +1,517 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Updates the security settings on a Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] CreateOrUpdateSecuritySettings=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataBoxEdgeDeviceSecuritySetting_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Updates the security settings on a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class UpdateAzDataBoxEdgeDeviceSecuritySetting_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The algorithm used to encrypt "Value". + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The algorithm used to encrypt \"Value\".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm DeviceAdminPasswordEncryptionAlgorithm { get => SecuritySettingsBody.DeviceAdminPasswordEncryptionAlgorithm; set => SecuritySettingsBody.DeviceAdminPasswordEncryptionAlgorithm = value; } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Thumbprint certificate used to encrypt \\\"Value\\\". If the value is unencrypted, it will be null.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + public string DeviceAdminPasswordEncryptionCertThumbprint { get => SecuritySettingsBody.DeviceAdminPasswordEncryptionCertThumbprint ?? null; set => SecuritySettingsBody.DeviceAdminPasswordEncryptionCertThumbprint = value; } + + /// The value of the secret. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The value of the secret.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value of the secret.", + 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettings _securitySettingsBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SecuritySettings(); + + /// The security settings of a device. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettings SecuritySettingsBody { get => this._securitySettingsBody; set => this._securitySettingsBody = 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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzDataBoxEdgeDeviceSecuritySetting_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.UpdateAzDataBoxEdgeDeviceSecuritySetting_UpdateExpanded Clone() + { + var clone = new UpdateAzDataBoxEdgeDeviceSecuritySetting_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; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesCreateOrUpdateSecuritySettings(DeviceName, SubscriptionId, ResourceGroupName, SecuritySettingsBody, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,body=SecuritySettingsBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzDataBoxEdgeDeviceSecuritySetting_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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, 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, 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/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeDeviceSecuritySetting_UpdateViaIdentityExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeDeviceSecuritySetting_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..2a741bae8db9 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeDeviceSecuritySetting_UpdateViaIdentityExpanded.cs @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Updates the security settings on a Data Box Edge/Data Box Gateway device. + /// + /// [OpenAPI] CreateOrUpdateSecuritySettings=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataBoxEdgeDeviceSecuritySetting_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Updates the security settings on a Data Box Edge/Data Box Gateway device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class UpdateAzDataBoxEdgeDeviceSecuritySetting_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The algorithm used to encrypt "Value". + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The algorithm used to encrypt \"Value\".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The algorithm used to encrypt ""Value"".", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.EncryptionAlgorithm DeviceAdminPasswordEncryptionAlgorithm { get => SecuritySettingsBody.DeviceAdminPasswordEncryptionAlgorithm; set => SecuritySettingsBody.DeviceAdminPasswordEncryptionAlgorithm = value; } + + /// + /// Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Thumbprint certificate used to encrypt \\\"Value\\\". If the value is unencrypted, it will be null.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate used to encrypt \""Value\"". If the value is unencrypted, it will be null.", + SerializedName = @"encryptionCertThumbprint", + PossibleTypes = new [] { typeof(string) })] + public string DeviceAdminPasswordEncryptionCertThumbprint { get => SecuritySettingsBody.DeviceAdminPasswordEncryptionCertThumbprint ?? null; set => SecuritySettingsBody.DeviceAdminPasswordEncryptionCertThumbprint = value; } + + /// The value of the secret. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The value of the secret.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value of the secret.", + 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettings _securitySettingsBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.SecuritySettings(); + + /// The security settings of a device. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.ISecuritySettings SecuritySettingsBody { get => this._securitySettingsBody; set => this._securitySettingsBody = 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzDataBoxEdgeDeviceSecuritySetting_UpdateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.UpdateAzDataBoxEdgeDeviceSecuritySetting_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzDataBoxEdgeDeviceSecuritySetting_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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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) ); + } + await this.Client.DevicesCreateOrUpdateSecuritySettings(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, SecuritySettingsBody, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public UpdateAzDataBoxEdgeDeviceSecuritySetting_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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeDevice_UpdateExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeDevice_UpdateExpanded.cs new file mode 100644 index 000000000000..e33c1d9e79d9 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeDevice_UpdateExpanded.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Modifies a Data Box Edge/Data Box Gateway resource. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataBoxEdgeDevice_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Modifies a Data Box Edge/Data Box Gateway resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class UpdateAzDataBoxEdgeDevice_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Identity type + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identity type")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identity type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType IdentityType { get => ParametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType)""); set => ParametersBody.IdentityType = 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatch _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevicePatch(); + + /// The Data Box Edge/Gateway device patch. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatch ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.HttpPipeline Pipeline { get; set; } + + /// The path ID that uniquely identifies the subscription of the edge profile. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The path ID that uniquely identifies the subscription of the edge profile.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The path ID that uniquely identifies the subscription of the edge profile.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + public string PropertiesEdgeProfileSubscriptionId { get => ParametersBody.SubscriptionId ?? null; set => ParametersBody.SubscriptionId = 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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// The tags attached to the Data Box Edge/Gateway resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tags attached to the Data Box Edge/Gateway resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tags attached to the Data Box Edge/Gateway resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags 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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesUpdate(Name, SubscriptionId, ResourceGroupName, ParametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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,body=ParametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzDataBoxEdgeDevice_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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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, 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 { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, 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 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeDevice_UpdateViaIdentityExpanded.cs b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeDevice_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..6d664df50cc7 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeDevice_UpdateViaIdentityExpanded.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Modifies a Data Box Edge/Data Box Gateway resource. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataBoxEdgeDevice_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Modifies a Data Box Edge/Data Box Gateway resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class UpdateAzDataBoxEdgeDevice_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Identity type + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identity type")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identity type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType IdentityType { get => ParametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Support.MsiIdentityType)""); set => ParametersBody.IdentityType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatch _parametersBody= new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.DataBoxEdgeDevicePatch(); + + /// The Data Box Edge/Gateway device patch. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatch ParametersBody { get => this._parametersBody; set => this._parametersBody = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The path ID that uniquely identifies the subscription of the edge profile. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The path ID that uniquely identifies the subscription of the edge profile.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The path ID that uniquely identifies the subscription of the edge profile.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + public string SubscriptionId { get => ParametersBody.SubscriptionId ?? null; set => ParametersBody.SubscriptionId = value; } + + /// The tags attached to the Data Box Edge/Gateway resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tags attached to the Data Box Edge/Gateway resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tags attached to the Data Box Edge/Gateway resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevicePatchTags 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 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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesUpdateViaIdentity(InputObject.Id, ParametersBody, 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) ); + } + await this.Client.DevicesUpdate(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, ParametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzDataBoxEdgeDevice_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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Models.Api20220301.IDataBoxEdgeDevice + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeShare_Refresh.cs b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeShare_Refresh.cs new file mode 100644 index 000000000000..31b09d04ea01 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeShare_Refresh.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Refreshes the share metadata with the data from the cloud. + /// + /// [OpenAPI] Refresh=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}/refresh" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataBoxEdgeShare_Refresh", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Refreshes the share metadata with the data from the cloud.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class UpdateAzDataBoxEdgeShare_Refresh : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The share name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The share name.")] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The share name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzDataBoxEdgeShare_Refresh + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.UpdateAzDataBoxEdgeShare_Refresh Clone() + { + var clone = new UpdateAzDataBoxEdgeShare_Refresh(); + 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; + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SharesRefresh' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SharesRefresh(DeviceName, Name, SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzDataBoxEdgeShare_Refresh() + { + + } + + /// + /// 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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 }) + { + 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 }) + { + 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/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeShare_RefreshViaIdentity.cs b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeShare_RefreshViaIdentity.cs new file mode 100644 index 000000000000..c6eec53846a5 --- /dev/null +++ b/swaggerci/databoxedge/generated/cmdlets/UpdateAzDataBoxEdgeShare_RefreshViaIdentity.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.DataBoxEdge.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Extensions; + using System; + + /// Refreshes the share metadata with the data from the cloud. + /// + /// [OpenAPI] Refresh=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}/refresh" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDataBoxEdgeShare_RefreshViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Description(@"Refreshes the share metadata with the data from the cloud.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Generated] + public partial class UpdateAzDataBoxEdgeShare_RefreshViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.DataBoxEdgeManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.IDataBoxEdgeIdentity 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.DataBoxEdge.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 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.DataBoxEdge.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzDataBoxEdgeShare_RefreshViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Cmdlets.UpdateAzDataBoxEdgeShare_RefreshViaIdentity Clone() + { + var clone = new UpdateAzDataBoxEdgeShare_RefreshViaIdentity(); + 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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SharesRefresh' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SharesRefreshViaIdentity(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.Name) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Name"),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) ); + } + await this.Client.SharesRefresh(InputObject.DeviceName ?? null, InputObject.Name ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzDataBoxEdgeShare_RefreshViaIdentity() + { + + } + + /// + /// 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 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)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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. + /// + /// 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/databoxedge/generated/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml new file mode 100644 index 000000000000..ae0c12dd4efa --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml new file mode 100644 index 000000000000..a81dae94b4db --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml new file mode 100644 index 000000000000..e3b670a7daff --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec new file mode 100644 index 000000000000..f664d888f3b8 --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 new file mode 100644 index 000000000000..5597a247fce7 --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 new file mode 100644 index 000000000000..67107181add7 --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Bcl.AsyncInterfaces.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Bcl.AsyncInterfaces.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll new file mode 100644 index 000000000000..18a53248894f Binary files /dev/null and b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll new file mode 100644 index 000000000000..92d06762d6a5 Binary files /dev/null and b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.Common.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.Common.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json b/swaggerci/databoxedge/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/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json new file mode 100644 index 000000000000..7828816a6777 --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json new file mode 100644 index 000000000000..ce563dfdebbe --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Compute.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Compute.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Network.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Network.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Websites.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Websites.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json b/swaggerci/databoxedge/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/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml b/swaggerci/databoxedge/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/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Storage.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Storage.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Strategies.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Strategies.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.Azure.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.Azure.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.DataMovement.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.DataMovement.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 new file mode 100644 index 000000000000..bb0bc9e63f5d --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Xml.ReaderWriter.dll b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Xml.ReaderWriter.dll differ diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 new file mode 100644 index 000000000000..f234bd2dd7e5 --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 new file mode 100644 index 000000000000..4e557723dc33 --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml new file mode 100644 index 000000000000..95d6227f2ef8 --- /dev/null +++ b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/_rels/.rels b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/_rels/.rels new file mode 100644 index 000000000000..95479a0e6d24 --- /dev/null +++ b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/_rels/.rels @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt b/swaggerci/databoxedge/generated/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt new file mode 100644 index 000000000000..7e294d272854 --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/generated/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp b/swaggerci/databoxedge/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/databoxedge/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/databoxedge/generated/runtime/AsyncCommandRuntime.cs b/swaggerci/databoxedge/generated/runtime/AsyncCommandRuntime.cs new file mode 100644 index 000000000000..c6eda38edcb8 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime.PowerShell +{ + using System.Management.Automation; + using System.Management.Automation.Host; + using System.Threading; + using System.Linq; + + internal interface IAsyncCommandRuntimeExtensions + { + Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep Wrap(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.SendAsyncStep Wrap(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/AsyncJob.cs b/swaggerci/databoxedge/generated/runtime/AsyncJob.cs new file mode 100644 index 000000000000..d7ed86c2c6f0 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/AsyncOperationResponse.cs b/swaggerci/databoxedge/generated/runtime/AsyncOperationResponse.cs new file mode 100644 index 000000000000..b437479aab35 --- /dev/null +++ b/swaggerci/databoxedge/generated/runtime/AsyncOperationResponse.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. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell +{ + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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 the + /// 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.DataBoxEdge.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 to the parameter using and + /// + /// 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/databoxedge/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs new file mode 100644 index 000000000000..0f3fc05f2f9e --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs new file mode 100644 index 000000000000..d66303c8c302 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs new file mode 100644 index 000000000000..5f2c0ab74f07 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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.DataBoxEdge.Models"; + private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs new file mode 100644 index 000000000000..3dcde5165087 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime.PowerShell.MarkdownRenderer; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs new file mode 100644 index 000000000000..3bc7053a59e7 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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.DataBoxEdge.Models"; + private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs new file mode 100644 index 000000000000..c115ff26ecfa --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime.PowerShell.PsHelpers; +using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.MarkdownRenderer; +using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.PsProxyTypeExtensions; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs new file mode 100644 index 000000000000..dbafce099220 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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: DataBoxEdge 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.DataBoxEdge.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.DataBoxEdge.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 DataBoxEdge".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/databoxedge/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs new file mode 100644 index 000000000000..2319b62b2ee5 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs new file mode 100644 index 000000000000..ee9180abe4cc --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs new file mode 100644 index 000000000000..9fd1f571bddd --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs new file mode 100644 index 000000000000..393baf4d0c84 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/CollectionExtensions.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/CollectionExtensions.cs new file mode 100644 index 000000000000..f5b869abd14c --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/MarkdownRenderer.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/MarkdownRenderer.cs new file mode 100644 index 000000000000..5f4aed7141cd --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.PsProxyOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/Models/PsFormatTypes.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/Models/PsFormatTypes.cs new file mode 100644 index 000000000000..1321a8bddd6d --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs new file mode 100644 index 000000000000..5f46fa5b4983 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime.PowerShell.PsHelpOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/Models/PsHelpTypes.cs new file mode 100644 index 000000000000..78055bc84c3c --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs new file mode 100644 index 000000000000..b1c7946a5c48 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.PsHelpOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/Models/PsProxyOutputs.cs new file mode 100644 index 000000000000..63b5703d9f88 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.PsProxyTypeExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.Runspace.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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/Models/PsProxyTypes.cs new file mode 100644 index 000000000000..64b5d791800a --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.PowerShell.PsProxyTypeExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/PsAttributes.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/PsAttributes.cs new file mode 100644 index 000000000000..d498ceadfd68 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge +{ + [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/databoxedge/generated/runtime/BuildTime/PsExtensions.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/PsExtensions.cs new file mode 100644 index 000000000000..69ae05e68e41 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/PsHelpers.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/PsHelpers.cs new file mode 100644 index 000000000000..2bc5e94a2903 --- /dev/null +++ b/swaggerci/databoxedge/generated/runtime/BuildTime/PsHelpers.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. + *--------------------------------------------------------------------------------------------*/ +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.DataBoxEdge.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 getCmdletsCommand = $@" +$currentFunctions = Get-ChildItem function: +Get-ChildItem -Path '{scriptFolder}' -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/databoxedge/generated/runtime/BuildTime/StringExtensions.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/StringExtensions.cs new file mode 100644 index 000000000000..ef38a49991c6 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/BuildTime/XmlExtensions.cs b/swaggerci/databoxedge/generated/runtime/BuildTime/XmlExtensions.cs new file mode 100644 index 000000000000..3d399571622d --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/CmdInfoHandler.cs b/swaggerci/databoxedge/generated/runtime/CmdInfoHandler.cs new file mode 100644 index 000000000000..9c985ecccb07 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/ConversionException.cs b/swaggerci/databoxedge/generated/runtime/Conversions/ConversionException.cs new file mode 100644 index 000000000000..23b082164c10 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/IJsonConverter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/IJsonConverter.cs new file mode 100644 index 000000000000..6431e00dd08a --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime.Json +{ + internal interface IJsonConverter + { + JsonNode ToJson(object value); + + object FromJson(JsonNode node); + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/runtime/Conversions/Instances/BinaryConverter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/BinaryConverter.cs new file mode 100644 index 000000000000..2ab0f892bab7 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/BooleanConverter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/BooleanConverter.cs new file mode 100644 index 000000000000..22e96c3922f7 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/DateTimeConverter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/DateTimeConverter.cs new file mode 100644 index 000000000000..e6a27e1ace68 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs new file mode 100644 index 000000000000..9bc245ac36f9 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/DecimalConverter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/DecimalConverter.cs new file mode 100644 index 000000000000..b8f04342f791 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/DoubleConverter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/DoubleConverter.cs new file mode 100644 index 000000000000..224de92f232a --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/EnumConverter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/EnumConverter.cs new file mode 100644 index 000000000000..21b729df504f --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/GuidConverter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/GuidConverter.cs new file mode 100644 index 000000000000..ade1a080efff --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/HashSet'1Converter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/HashSet'1Converter.cs new file mode 100644 index 000000000000..45f445e1d92a --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/Int16Converter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/Int16Converter.cs new file mode 100644 index 000000000000..0d5aa01a4a01 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/Int32Converter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/Int32Converter.cs new file mode 100644 index 000000000000..cd88eeed2cc8 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/Int64Converter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/Int64Converter.cs new file mode 100644 index 000000000000..121308443b91 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/JsonArrayConverter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/JsonArrayConverter.cs new file mode 100644 index 000000000000..cdeff0f57924 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/JsonObjectConverter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/JsonObjectConverter.cs new file mode 100644 index 000000000000..100b4b0a6ace --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/SingleConverter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/SingleConverter.cs new file mode 100644 index 000000000000..646db0db8355 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/StringConverter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/StringConverter.cs new file mode 100644 index 000000000000..0479fc31a470 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/TimeSpanConverter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/TimeSpanConverter.cs new file mode 100644 index 000000000000..25fd11478e36 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/UInt16Converter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/UInt16Converter.cs new file mode 100644 index 000000000000..0b1197aad202 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/UInt32Converter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/UInt32Converter.cs new file mode 100644 index 000000000000..2525ebaac101 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/UInt64Converter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/UInt64Converter.cs new file mode 100644 index 000000000000..5013025af80c --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/Instances/UriConverter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/Instances/UriConverter.cs new file mode 100644 index 000000000000..0aa8eaf4b1b0 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/JsonConverter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/JsonConverter.cs new file mode 100644 index 000000000000..06585d7ebbeb --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/JsonConverterAttribute.cs b/swaggerci/databoxedge/generated/runtime/Conversions/JsonConverterAttribute.cs new file mode 100644 index 000000000000..3b775155e4ca --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/JsonConverterFactory.cs b/swaggerci/databoxedge/generated/runtime/Conversions/JsonConverterFactory.cs new file mode 100644 index 000000000000..4535f0ff4451 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Conversions/StringLikeConverter.cs b/swaggerci/databoxedge/generated/runtime/Conversions/StringLikeConverter.cs new file mode 100644 index 000000000000..1711c16897bd --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Customizations/IJsonSerializable.cs b/swaggerci/databoxedge/generated/runtime/Customizations/IJsonSerializable.cs new file mode 100644 index 000000000000..1e958e2a3731 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime.Json; +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/generated/runtime/Customizations/JsonArray.cs b/swaggerci/databoxedge/generated/runtime/Customizations/JsonArray.cs new file mode 100644 index 000000000000..9d38c7639210 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Customizations/JsonBoolean.cs b/swaggerci/databoxedge/generated/runtime/Customizations/JsonBoolean.cs new file mode 100644 index 000000000000..3b12e414e654 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Customizations/JsonNode.cs b/swaggerci/databoxedge/generated/runtime/Customizations/JsonNode.cs new file mode 100644 index 000000000000..aae8cca69eed --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Customizations/JsonNumber.cs b/swaggerci/databoxedge/generated/runtime/Customizations/JsonNumber.cs new file mode 100644 index 000000000000..975b2b296dfe --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Customizations/JsonObject.cs b/swaggerci/databoxedge/generated/runtime/Customizations/JsonObject.cs new file mode 100644 index 000000000000..93ae696e64e2 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime.Json +{ + using System; + using System.Collections.Generic; + + public partial class JsonObject + { + internal override object ToValue() => Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/Customizations/JsonString.cs b/swaggerci/databoxedge/generated/runtime/Customizations/JsonString.cs new file mode 100644 index 000000000000..1238ee1c1e11 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Customizations/XNodeArray.cs b/swaggerci/databoxedge/generated/runtime/Customizations/XNodeArray.cs new file mode 100644 index 000000000000..c3c3c6fa8a41 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Debugging.cs b/swaggerci/databoxedge/generated/runtime/Debugging.cs new file mode 100644 index 000000000000..135bb1c5b73c --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/DictionaryExtensions.cs b/swaggerci/databoxedge/generated/runtime/DictionaryExtensions.cs new file mode 100644 index 000000000000..6ca0f8c52659 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/EventData.cs b/swaggerci/databoxedge/generated/runtime/EventData.cs new file mode 100644 index 000000000000..be096f4b27aa --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/EventDataExtensions.cs b/swaggerci/databoxedge/generated/runtime/EventDataExtensions.cs new file mode 100644 index 000000000000..efbbf522aa97 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime +{ + using System; + + [System.ComponentModel.TypeConverter(typeof(EventDataConverter))] + /// + /// 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. + /// + 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/databoxedge/generated/runtime/EventListener.cs b/swaggerci/databoxedge/generated/runtime/EventListener.cs new file mode 100644 index 000000000000..62ff961a36ab --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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.DataBoxEdge.Runtime.Extensions; + + public interface IValidates + { + Task Validate(Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/Events.cs b/swaggerci/databoxedge/generated/runtime/Events.cs new file mode 100644 index 000000000000..949fd6683e96 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/EventsExtensions.cs b/swaggerci/databoxedge/generated/runtime/EventsExtensions.cs new file mode 100644 index 000000000000..fcd78485c569 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Extensions.cs b/swaggerci/databoxedge/generated/runtime/Extensions.cs new file mode 100644 index 000000000000..03ec3c4587da --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs b/swaggerci/databoxedge/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs new file mode 100644 index 000000000000..c277292fad51 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Helpers/Extensions/TypeExtensions.cs b/swaggerci/databoxedge/generated/runtime/Helpers/Extensions/TypeExtensions.cs new file mode 100644 index 000000000000..3aeeaf0c497c --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Helpers/Seperator.cs b/swaggerci/databoxedge/generated/runtime/Helpers/Seperator.cs new file mode 100644 index 000000000000..3ff4a4fa3e51 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime.Json +{ + internal static class Seperator + { + internal static readonly char[] Dash = { '-' }; + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/runtime/Helpers/TypeDetails.cs b/swaggerci/databoxedge/generated/runtime/Helpers/TypeDetails.cs new file mode 100644 index 000000000000..372e8eb8fc71 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Helpers/XHelper.cs b/swaggerci/databoxedge/generated/runtime/Helpers/XHelper.cs new file mode 100644 index 000000000000..ad788e5179f3 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/HttpPipeline.cs b/swaggerci/databoxedge/generated/runtime/HttpPipeline.cs new file mode 100644 index 000000000000..b02e1da8f83e --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/HttpPipelineMocking.ps1 b/swaggerci/databoxedge/generated/runtime/HttpPipelineMocking.ps1 new file mode 100644 index 000000000000..4b65b534754c --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/IAssociativeArray.cs b/swaggerci/databoxedge/generated/runtime/IAssociativeArray.cs new file mode 100644 index 000000000000..a1c0099990c4 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/IHeaderSerializable.cs b/swaggerci/databoxedge/generated/runtime/IHeaderSerializable.cs new file mode 100644 index 000000000000..42dc89c99715 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime +{ + public interface IHeaderSerializable + { + void ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers); + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/runtime/ISendAsync.cs b/swaggerci/databoxedge/generated/runtime/ISendAsync.cs new file mode 100644 index 000000000000..5201b97cdda1 --- /dev/null +++ b/swaggerci/databoxedge/generated/runtime/ISendAsync.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. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/InfoAttribute.cs b/swaggerci/databoxedge/generated/runtime/InfoAttribute.cs new file mode 100644 index 000000000000..d8d136db708c --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Iso/IsoDate.cs b/swaggerci/databoxedge/generated/runtime/Iso/IsoDate.cs new file mode 100644 index 000000000000..90c8eb3cd732 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/JsonType.cs b/swaggerci/databoxedge/generated/runtime/JsonType.cs new file mode 100644 index 000000000000..d8a52b7ba03e --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/MessageAttribute.cs b/swaggerci/databoxedge/generated/runtime/MessageAttribute.cs new file mode 100644 index 000000000000..97902e162466 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/MessageAttributeHelper.cs b/swaggerci/databoxedge/generated/runtime/MessageAttributeHelper.cs new file mode 100644 index 000000000000..155dd4072e20 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime +{ + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/Method.cs b/swaggerci/databoxedge/generated/runtime/Method.cs new file mode 100644 index 000000000000..3cf1984f7c7a --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Models/JsonMember.cs b/swaggerci/databoxedge/generated/runtime/Models/JsonMember.cs new file mode 100644 index 000000000000..6f1609bad267 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Models/JsonModel.cs b/swaggerci/databoxedge/generated/runtime/Models/JsonModel.cs new file mode 100644 index 000000000000..20d410e1a11d --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Models/JsonModelCache.cs b/swaggerci/databoxedge/generated/runtime/Models/JsonModelCache.cs new file mode 100644 index 000000000000..2b0f4f56df1d --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Nodes/Collections/JsonArray.cs b/swaggerci/databoxedge/generated/runtime/Nodes/Collections/JsonArray.cs new file mode 100644 index 000000000000..0d5b00197385 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Nodes/Collections/XImmutableArray.cs b/swaggerci/databoxedge/generated/runtime/Nodes/Collections/XImmutableArray.cs new file mode 100644 index 000000000000..53767d92ee0e --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Nodes/Collections/XList.cs b/swaggerci/databoxedge/generated/runtime/Nodes/Collections/XList.cs new file mode 100644 index 000000000000..169712681e4f --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Nodes/Collections/XNodeArray.cs b/swaggerci/databoxedge/generated/runtime/Nodes/Collections/XNodeArray.cs new file mode 100644 index 000000000000..a2d7bd93ca96 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Nodes/Collections/XSet.cs b/swaggerci/databoxedge/generated/runtime/Nodes/Collections/XSet.cs new file mode 100644 index 000000000000..48323321c323 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Nodes/JsonBoolean.cs b/swaggerci/databoxedge/generated/runtime/Nodes/JsonBoolean.cs new file mode 100644 index 000000000000..3c3fdca339bc --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Nodes/JsonDate.cs b/swaggerci/databoxedge/generated/runtime/Nodes/JsonDate.cs new file mode 100644 index 000000000000..d43891a8d51a --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Nodes/JsonNode.cs b/swaggerci/databoxedge/generated/runtime/Nodes/JsonNode.cs new file mode 100644 index 000000000000..4d3bc82bedc0 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Nodes/JsonNumber.cs b/swaggerci/databoxedge/generated/runtime/Nodes/JsonNumber.cs new file mode 100644 index 000000000000..7fddf8ae8ea8 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Nodes/JsonObject.cs b/swaggerci/databoxedge/generated/runtime/Nodes/JsonObject.cs new file mode 100644 index 000000000000..21bdcd60596e --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Nodes/JsonString.cs b/swaggerci/databoxedge/generated/runtime/Nodes/JsonString.cs new file mode 100644 index 000000000000..36401db84dfa --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Nodes/XBinary.cs b/swaggerci/databoxedge/generated/runtime/Nodes/XBinary.cs new file mode 100644 index 000000000000..3c4f5a8f3d13 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Nodes/XNull.cs b/swaggerci/databoxedge/generated/runtime/Nodes/XNull.cs new file mode 100644 index 000000000000..ccba915b25c3 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Parser/Exceptions/ParseException.cs b/swaggerci/databoxedge/generated/runtime/Parser/Exceptions/ParseException.cs new file mode 100644 index 000000000000..fa30c8e344f3 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Parser/JsonParser.cs b/swaggerci/databoxedge/generated/runtime/Parser/JsonParser.cs new file mode 100644 index 000000000000..3176087ff9b4 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Parser/JsonToken.cs b/swaggerci/databoxedge/generated/runtime/Parser/JsonToken.cs new file mode 100644 index 000000000000..f1424e5c2b49 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Parser/JsonTokenizer.cs b/swaggerci/databoxedge/generated/runtime/Parser/JsonTokenizer.cs new file mode 100644 index 000000000000..4548f89d9e39 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Parser/Location.cs b/swaggerci/databoxedge/generated/runtime/Parser/Location.cs new file mode 100644 index 000000000000..9956993ddd9a --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Parser/Readers/SourceReader.cs b/swaggerci/databoxedge/generated/runtime/Parser/Readers/SourceReader.cs new file mode 100644 index 000000000000..304384343ef1 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Parser/TokenReader.cs b/swaggerci/databoxedge/generated/runtime/Parser/TokenReader.cs new file mode 100644 index 000000000000..060351aa7b87 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/PipelineMocking.cs b/swaggerci/databoxedge/generated/runtime/PipelineMocking.cs new file mode 100644 index 000000000000..6cf01e5476fd --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime +{ + using System.Threading.Tasks; + using System.Collections.Generic; + using System.Net.Http; + using System.Linq; + using System.Net; + using Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.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); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/databoxedge/generated/runtime/Properties/Resources.Designer.cs b/swaggerci/databoxedge/generated/runtime/Properties/Resources.Designer.cs new file mode 100644 index 000000000000..3b725d1683bd --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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.DataBoxEdge.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/databoxedge/generated/runtime/Properties/Resources.resx b/swaggerci/databoxedge/generated/runtime/Properties/Resources.resx new file mode 100644 index 000000000000..598cd53e958a --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/generated/runtime/Response.cs b/swaggerci/databoxedge/generated/runtime/Response.cs new file mode 100644 index 000000000000..cb9740f90b1e --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Serialization/JsonSerializer.cs b/swaggerci/databoxedge/generated/runtime/Serialization/JsonSerializer.cs new file mode 100644 index 000000000000..855ce58759f8 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Serialization/PropertyTransformation.cs b/swaggerci/databoxedge/generated/runtime/Serialization/PropertyTransformation.cs new file mode 100644 index 000000000000..e4132ac6e702 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/Serialization/SerializationOptions.cs b/swaggerci/databoxedge/generated/runtime/Serialization/SerializationOptions.cs new file mode 100644 index 000000000000..6b4314ec750d --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/SerializationMode.cs b/swaggerci/databoxedge/generated/runtime/SerializationMode.cs new file mode 100644 index 000000000000..69d2f86c1627 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/TypeConverterExtensions.cs b/swaggerci/databoxedge/generated/runtime/TypeConverterExtensions.cs new file mode 100644 index 000000000000..812717582b1b --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/UndeclaredResponseException.cs b/swaggerci/databoxedge/generated/runtime/UndeclaredResponseException.cs new file mode 100644 index 000000000000..8edcb63ca0fc --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.Runtime +{ + using System; + using System.Net.Http; + using System.Net.Http.Headers; + using static Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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.DataBoxEdge.Runtime.Json.JsonNode.Parse(ResponseBody) as Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/generated/runtime/Writers/JsonWriter.cs b/swaggerci/databoxedge/generated/runtime/Writers/JsonWriter.cs new file mode 100644 index 000000000000..0c078258944f --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/generated/runtime/delegates.cs b/swaggerci/databoxedge/generated/runtime/delegates.cs new file mode 100644 index 000000000000..10d089814795 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/how-to.md b/swaggerci/databoxedge/how-to.md new file mode 100644 index 000000000000..22166daf5f2c --- /dev/null +++ b/swaggerci/databoxedge/how-to.md @@ -0,0 +1,58 @@ +# How-To +This document describes how to develop for `Az.DataBoxEdge`. + +## Building `Az.DataBoxEdge` +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.DataBoxEdge` +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.DataBoxEdge` +To pack `Az.DataBoxEdge` 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.DataBoxEdge`. +- `build-module.ps1` + - Builds the module DLL (`./bin/Az.DataBoxEdge.private.dll`), creates the exported cmdlets and documentation, generates custom cmdlet test stubs and exported cmdlet example stubs, and updates `./Az.DataBoxEdge.psd1` with Azure profile information. + - **Parameters**: [`Switch` parameters] + - `-Run`: After building, creates an isolated PowerShell session and loads `Az.DataBoxEdge`. + - `-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.DataBoxEdge` 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/databoxedge/internal/Az.DataBoxEdge.internal.psm1 b/swaggerci/databoxedge/internal/Az.DataBoxEdge.internal.psm1 new file mode 100644 index 000000000000..b45074beb2ea --- /dev/null +++ b/swaggerci/databoxedge/internal/Az.DataBoxEdge.internal.psm1 @@ -0,0 +1,38 @@ +# region Generated + # Load the private module dll + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.DataBoxEdge.private.dll') + + # Get the private module's instance + $instance = [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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/databoxedge/internal/Get-AzDataBoxEdgeOperation.ps1 b/swaggerci/databoxedge/internal/Get-AzDataBoxEdgeOperation.ps1 new file mode 100644 index 000000000000..fc84cb43b8a5 --- /dev/null +++ b/swaggerci/databoxedge/internal/Get-AzDataBoxEdgeOperation.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List all the supported operations. +.Description +List all the supported operations. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperation +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeoperation +#> +function Get-AzDataBoxEdgeOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperation])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + + $mapping = @{ + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeOperation_List'; + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/swaggerci/databoxedge/internal/ProxyCmdletDefinitions.ps1 b/swaggerci/databoxedge/internal/ProxyCmdletDefinitions.ps1 new file mode 100644 index 000000000000..fc84cb43b8a5 --- /dev/null +++ b/swaggerci/databoxedge/internal/ProxyCmdletDefinitions.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List all the supported operations. +.Description +List all the supported operations. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperation +.Link +https://docs.microsoft.com/en-us/powershell/module/az.databoxedge/get-azdataboxedgeoperation +#> +function Get-AzDataBoxEdgeOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Models.Api20220301.IOperation])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.DataBoxEdge.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 + + $mapping = @{ + List = 'Az.DataBoxEdge.private\Get-AzDataBoxEdgeOperation_List'; + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/swaggerci/databoxedge/internal/README.md b/swaggerci/databoxedge/internal/README.md new file mode 100644 index 000000000000..c219181cd9ec --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.DataBoxEdge`. Instead, this sub-module is imported by the `../custom/Az.DataBoxEdge.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.DataBoxEdge.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.DataBoxEdge`. diff --git a/swaggerci/databoxedge/license.txt b/swaggerci/databoxedge/license.txt new file mode 100644 index 000000000000..b9f3180fb9af --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/pack-module.ps1 b/swaggerci/databoxedge/pack-module.ps1 new file mode 100644 index 000000000000..8ed48957e579 --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/readme.md b/swaggerci/databoxedge/readme.md new file mode 100644 index 000000000000..74d3bc2caf37 --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/resource-manager/readme.md +try-require: + - $(this-folder)/../../../azure-rest-api-specs/specification/databoxedge/resource-manager/readme.powershell.md +``` diff --git a/swaggerci/databoxedge/resources/README.md b/swaggerci/databoxedge/resources/README.md new file mode 100644 index 000000000000..736492341e3d --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/run-module.ps1 b/swaggerci/databoxedge/run-module.ps1 new file mode 100644 index 000000000000..06687996c0c6 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/test-module.ps1 b/swaggerci/databoxedge/test-module.ps1 new file mode 100644 index 000000000000..4ec5d3b28e38 --- /dev/null +++ b/swaggerci/databoxedge/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.DataBoxEdge.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/databoxedge/test/Get-AzDataBoxEdgeAddon.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeAddon.Tests.ps1 new file mode 100644 index 000000000000..53594b1c912d --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeAddon.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeAddon')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeAddon.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-AzDataBoxEdgeAddon' { + 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/databoxedge/test/Get-AzDataBoxEdgeAlert.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeAlert.Tests.ps1 new file mode 100644 index 000000000000..0540d4bbb845 --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeAlert.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeAlert')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeAlert.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-AzDataBoxEdgeAlert' { + 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/databoxedge/test/Get-AzDataBoxEdgeAvailableSku.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeAvailableSku.Tests.ps1 new file mode 100644 index 000000000000..6fb90afd1f92 --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeAvailableSku.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeAvailableSku')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeAvailableSku.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-AzDataBoxEdgeAvailableSku' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Get-AzDataBoxEdgeBandwidthSchedule.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeBandwidthSchedule.Tests.ps1 new file mode 100644 index 000000000000..80cff5afa16d --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeBandwidthSchedule.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeBandwidthSchedule')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeBandwidthSchedule.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-AzDataBoxEdgeBandwidthSchedule' { + 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/databoxedge/test/Get-AzDataBoxEdgeContainer.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeContainer.Tests.ps1 new file mode 100644 index 000000000000..6b392c8270f3 --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeContainer.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeContainer')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeContainer.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-AzDataBoxEdgeContainer' { + 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/databoxedge/test/Get-AzDataBoxEdgeDevice.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeDevice.Tests.ps1 new file mode 100644 index 000000000000..a35a18c11967 --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeDevice.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeDevice')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeDevice.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-AzDataBoxEdgeDevice' { + 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/databoxedge/test/Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo.Tests.ps1 new file mode 100644 index 000000000000..5c430effefcc --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo.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-AzDataBoxEdgeDeviceCapacityInfoDeviceCapacityInfo' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Get-AzDataBoxEdgeDeviceExtendedInformation.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeDeviceExtendedInformation.Tests.ps1 new file mode 100644 index 000000000000..4b28ddd7be4e --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeDeviceExtendedInformation.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeDeviceExtendedInformation')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeDeviceExtendedInformation.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-AzDataBoxEdgeDeviceExtendedInformation' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Get-AzDataBoxEdgeDeviceNetworkSetting.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeDeviceNetworkSetting.Tests.ps1 new file mode 100644 index 000000000000..f0e929f397ae --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeDeviceNetworkSetting.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeDeviceNetworkSetting')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeDeviceNetworkSetting.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-AzDataBoxEdgeDeviceNetworkSetting' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Get-AzDataBoxEdgeDeviceUpdateSummary.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeDeviceUpdateSummary.Tests.ps1 new file mode 100644 index 000000000000..8631241d3bb9 --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeDeviceUpdateSummary.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeDeviceUpdateSummary')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeDeviceUpdateSummary.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-AzDataBoxEdgeDeviceUpdateSummary' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting.Tests.ps1 new file mode 100644 index 000000000000..f19e8021e14a --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting.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-AzDataBoxEdgeDiagnosticSettingDiagnosticProactiveLogCollectionSetting' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting.Tests.ps1 new file mode 100644 index 000000000000..11dc75ab115b --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting.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-AzDataBoxEdgeDiagnosticSettingDiagnosticRemoteSupportSetting' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Get-AzDataBoxEdgeJob.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeJob.Tests.ps1 new file mode 100644 index 000000000000..290311c6b3ac --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeJob.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeJob')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeJob.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-AzDataBoxEdgeJob' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Get-AzDataBoxEdgeMonitoringConfig.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeMonitoringConfig.Tests.ps1 new file mode 100644 index 000000000000..29d23896890d --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeMonitoringConfig.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeMonitoringConfig')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeMonitoringConfig.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-AzDataBoxEdgeMonitoringConfig' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Get-AzDataBoxEdgeNode.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeNode.Tests.ps1 new file mode 100644 index 000000000000..dbe795848984 --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeNode.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeNode')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeNode.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-AzDataBoxEdgeNode' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Get-AzDataBoxEdgeOperationsStatus.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeOperationsStatus.Tests.ps1 new file mode 100644 index 000000000000..550b33963f24 --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeOperationsStatus.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeOperationsStatus')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeOperationsStatus.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-AzDataBoxEdgeOperationsStatus' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Get-AzDataBoxEdgeOrder.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeOrder.Tests.ps1 new file mode 100644 index 000000000000..61c2b44a4f5a --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeOrder.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeOrder')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeOrder.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-AzDataBoxEdgeOrder' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Get-AzDataBoxEdgeOrderDcAccessCode.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeOrderDcAccessCode.Tests.ps1 new file mode 100644 index 000000000000..8935218b74bd --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeOrderDcAccessCode.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeOrderDcAccessCode')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeOrderDcAccessCode.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-AzDataBoxEdgeOrderDcAccessCode' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Get-AzDataBoxEdgeRole.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeRole.Tests.ps1 new file mode 100644 index 000000000000..051ad5146fc8 --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeRole.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeRole')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeRole.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-AzDataBoxEdgeRole' { + 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/databoxedge/test/Get-AzDataBoxEdgeShare.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeShare.Tests.ps1 new file mode 100644 index 000000000000..720c149d6533 --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeShare.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeShare')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeShare.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-AzDataBoxEdgeShare' { + 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/databoxedge/test/Get-AzDataBoxEdgeStorageAccount.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeStorageAccount.Tests.ps1 new file mode 100644 index 000000000000..dc2db9d2be8c --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeStorageAccount.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeStorageAccount')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeStorageAccount.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-AzDataBoxEdgeStorageAccount' { + 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/databoxedge/test/Get-AzDataBoxEdgeStorageAccountCredentials.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeStorageAccountCredentials.Tests.ps1 new file mode 100644 index 000000000000..6c093a7ce3e0 --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeStorageAccountCredentials.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeStorageAccountCredentials')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeStorageAccountCredentials.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-AzDataBoxEdgeStorageAccountCredentials' { + 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/databoxedge/test/Get-AzDataBoxEdgeTrigger.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeTrigger.Tests.ps1 new file mode 100644 index 000000000000..8850ad70f0a0 --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeTrigger.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeTrigger')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeTrigger.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-AzDataBoxEdgeTrigger' { + 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/databoxedge/test/Get-AzDataBoxEdgeUser.Tests.ps1 b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeUser.Tests.ps1 new file mode 100644 index 000000000000..f41c16c8d78a --- /dev/null +++ b/swaggerci/databoxedge/test/Get-AzDataBoxEdgeUser.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzDataBoxEdgeUser')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzDataBoxEdgeUser.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-AzDataBoxEdgeUser' { + 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/databoxedge/test/Install-AzDataBoxEdgeDeviceUpdate.Tests.ps1 b/swaggerci/databoxedge/test/Install-AzDataBoxEdgeDeviceUpdate.Tests.ps1 new file mode 100644 index 000000000000..92205ebaea0c --- /dev/null +++ b/swaggerci/databoxedge/test/Install-AzDataBoxEdgeDeviceUpdate.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Install-AzDataBoxEdgeDeviceUpdate')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Install-AzDataBoxEdgeDeviceUpdate.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-AzDataBoxEdgeDeviceUpdate' { + It 'Install' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'InstallViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Invoke-AzDataBoxEdgeDownloadDeviceUpdate.Tests.ps1 b/swaggerci/databoxedge/test/Invoke-AzDataBoxEdgeDownloadDeviceUpdate.Tests.ps1 new file mode 100644 index 000000000000..1daac93509df --- /dev/null +++ b/swaggerci/databoxedge/test/Invoke-AzDataBoxEdgeDownloadDeviceUpdate.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzDataBoxEdgeDownloadDeviceUpdate')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzDataBoxEdgeDownloadDeviceUpdate.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-AzDataBoxEdgeDownloadDeviceUpdate' { + It 'Download' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DownloadViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Invoke-AzDataBoxEdgeScanDevice.Tests.ps1 b/swaggerci/databoxedge/test/Invoke-AzDataBoxEdgeScanDevice.Tests.ps1 new file mode 100644 index 000000000000..7d9ffa32a47d --- /dev/null +++ b/swaggerci/databoxedge/test/Invoke-AzDataBoxEdgeScanDevice.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzDataBoxEdgeScanDevice')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzDataBoxEdgeScanDevice.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-AzDataBoxEdgeScanDevice' { + It 'Scan' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ScanViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Invoke-AzDataBoxEdgeUploadDeviceCertificate.Tests.ps1 b/swaggerci/databoxedge/test/Invoke-AzDataBoxEdgeUploadDeviceCertificate.Tests.ps1 new file mode 100644 index 000000000000..0439b957517f --- /dev/null +++ b/swaggerci/databoxedge/test/Invoke-AzDataBoxEdgeUploadDeviceCertificate.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzDataBoxEdgeUploadDeviceCertificate')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzDataBoxEdgeUploadDeviceCertificate.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-AzDataBoxEdgeUploadDeviceCertificate' { + 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/databoxedge/test/New-AzDataBoxEdgeAddon.Tests.ps1 b/swaggerci/databoxedge/test/New-AzDataBoxEdgeAddon.Tests.ps1 new file mode 100644 index 000000000000..db620f249f8a --- /dev/null +++ b/swaggerci/databoxedge/test/New-AzDataBoxEdgeAddon.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataBoxEdgeAddon')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataBoxEdgeAddon.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-AzDataBoxEdgeAddon' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/New-AzDataBoxEdgeBandwidthSchedule.Tests.ps1 b/swaggerci/databoxedge/test/New-AzDataBoxEdgeBandwidthSchedule.Tests.ps1 new file mode 100644 index 000000000000..5848e09484c8 --- /dev/null +++ b/swaggerci/databoxedge/test/New-AzDataBoxEdgeBandwidthSchedule.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataBoxEdgeBandwidthSchedule')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataBoxEdgeBandwidthSchedule.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-AzDataBoxEdgeBandwidthSchedule' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/New-AzDataBoxEdgeContainer.Tests.ps1 b/swaggerci/databoxedge/test/New-AzDataBoxEdgeContainer.Tests.ps1 new file mode 100644 index 000000000000..f78be3157bdc --- /dev/null +++ b/swaggerci/databoxedge/test/New-AzDataBoxEdgeContainer.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataBoxEdgeContainer')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataBoxEdgeContainer.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-AzDataBoxEdgeContainer' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/New-AzDataBoxEdgeDevice.Tests.ps1 b/swaggerci/databoxedge/test/New-AzDataBoxEdgeDevice.Tests.ps1 new file mode 100644 index 000000000000..5f357468e2d0 --- /dev/null +++ b/swaggerci/databoxedge/test/New-AzDataBoxEdgeDevice.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataBoxEdgeDevice')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataBoxEdgeDevice.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-AzDataBoxEdgeDevice' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/New-AzDataBoxEdgeDeviceCertificate.Tests.ps1 b/swaggerci/databoxedge/test/New-AzDataBoxEdgeDeviceCertificate.Tests.ps1 new file mode 100644 index 000000000000..5814783ca954 --- /dev/null +++ b/swaggerci/databoxedge/test/New-AzDataBoxEdgeDeviceCertificate.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataBoxEdgeDeviceCertificate')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataBoxEdgeDeviceCertificate.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-AzDataBoxEdgeDeviceCertificate' { + It 'Generate' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GenerateViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/New-AzDataBoxEdgeDeviceSecuritySetting.Tests.ps1 b/swaggerci/databoxedge/test/New-AzDataBoxEdgeDeviceSecuritySetting.Tests.ps1 new file mode 100644 index 000000000000..6d9329bf987a --- /dev/null +++ b/swaggerci/databoxedge/test/New-AzDataBoxEdgeDeviceSecuritySetting.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataBoxEdgeDeviceSecuritySetting')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataBoxEdgeDeviceSecuritySetting.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-AzDataBoxEdgeDeviceSecuritySetting' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/New-AzDataBoxEdgeMonitoringConfig.Tests.ps1 b/swaggerci/databoxedge/test/New-AzDataBoxEdgeMonitoringConfig.Tests.ps1 new file mode 100644 index 000000000000..2412c452e265 --- /dev/null +++ b/swaggerci/databoxedge/test/New-AzDataBoxEdgeMonitoringConfig.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataBoxEdgeMonitoringConfig')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataBoxEdgeMonitoringConfig.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-AzDataBoxEdgeMonitoringConfig' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/New-AzDataBoxEdgeOrder.Tests.ps1 b/swaggerci/databoxedge/test/New-AzDataBoxEdgeOrder.Tests.ps1 new file mode 100644 index 000000000000..fdd4411d5d8e --- /dev/null +++ b/swaggerci/databoxedge/test/New-AzDataBoxEdgeOrder.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataBoxEdgeOrder')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataBoxEdgeOrder.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-AzDataBoxEdgeOrder' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/New-AzDataBoxEdgeRole.Tests.ps1 b/swaggerci/databoxedge/test/New-AzDataBoxEdgeRole.Tests.ps1 new file mode 100644 index 000000000000..c7e7b49b6ede --- /dev/null +++ b/swaggerci/databoxedge/test/New-AzDataBoxEdgeRole.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataBoxEdgeRole')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataBoxEdgeRole.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-AzDataBoxEdgeRole' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/New-AzDataBoxEdgeShare.Tests.ps1 b/swaggerci/databoxedge/test/New-AzDataBoxEdgeShare.Tests.ps1 new file mode 100644 index 000000000000..708f63b6049a --- /dev/null +++ b/swaggerci/databoxedge/test/New-AzDataBoxEdgeShare.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataBoxEdgeShare')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataBoxEdgeShare.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-AzDataBoxEdgeShare' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/New-AzDataBoxEdgeStorageAccount.Tests.ps1 b/swaggerci/databoxedge/test/New-AzDataBoxEdgeStorageAccount.Tests.ps1 new file mode 100644 index 000000000000..fecb255f61af --- /dev/null +++ b/swaggerci/databoxedge/test/New-AzDataBoxEdgeStorageAccount.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataBoxEdgeStorageAccount')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataBoxEdgeStorageAccount.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-AzDataBoxEdgeStorageAccount' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/New-AzDataBoxEdgeStorageAccountCredentials.Tests.ps1 b/swaggerci/databoxedge/test/New-AzDataBoxEdgeStorageAccountCredentials.Tests.ps1 new file mode 100644 index 000000000000..612ffa4b61ed --- /dev/null +++ b/swaggerci/databoxedge/test/New-AzDataBoxEdgeStorageAccountCredentials.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataBoxEdgeStorageAccountCredentials')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataBoxEdgeStorageAccountCredentials.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-AzDataBoxEdgeStorageAccountCredentials' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/New-AzDataBoxEdgeTrigger.Tests.ps1 b/swaggerci/databoxedge/test/New-AzDataBoxEdgeTrigger.Tests.ps1 new file mode 100644 index 000000000000..ed69195611aa --- /dev/null +++ b/swaggerci/databoxedge/test/New-AzDataBoxEdgeTrigger.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataBoxEdgeTrigger')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataBoxEdgeTrigger.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-AzDataBoxEdgeTrigger' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/New-AzDataBoxEdgeUser.Tests.ps1 b/swaggerci/databoxedge/test/New-AzDataBoxEdgeUser.Tests.ps1 new file mode 100644 index 000000000000..c8ea18f488af --- /dev/null +++ b/swaggerci/databoxedge/test/New-AzDataBoxEdgeUser.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzDataBoxEdgeUser')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzDataBoxEdgeUser.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-AzDataBoxEdgeUser' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/README.md b/swaggerci/databoxedge/test/README.md new file mode 100644 index 000000000000..1969200c6a09 --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/test/Remove-AzDataBoxEdgeAddon.Tests.ps1 b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeAddon.Tests.ps1 new file mode 100644 index 000000000000..18ff0e6ea5ee --- /dev/null +++ b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeAddon.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataBoxEdgeAddon')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataBoxEdgeAddon.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-AzDataBoxEdgeAddon' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeBandwidthSchedule.Tests.ps1 b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeBandwidthSchedule.Tests.ps1 new file mode 100644 index 000000000000..2200aac4f08d --- /dev/null +++ b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeBandwidthSchedule.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataBoxEdgeBandwidthSchedule')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataBoxEdgeBandwidthSchedule.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-AzDataBoxEdgeBandwidthSchedule' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeContainer.Tests.ps1 b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeContainer.Tests.ps1 new file mode 100644 index 000000000000..5be095b825c6 --- /dev/null +++ b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeContainer.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataBoxEdgeContainer')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataBoxEdgeContainer.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-AzDataBoxEdgeContainer' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeDevice.Tests.ps1 b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeDevice.Tests.ps1 new file mode 100644 index 000000000000..171e9183afb2 --- /dev/null +++ b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeDevice.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataBoxEdgeDevice')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataBoxEdgeDevice.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-AzDataBoxEdgeDevice' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeMonitoringConfig.Tests.ps1 b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeMonitoringConfig.Tests.ps1 new file mode 100644 index 000000000000..9a2e900f1f86 --- /dev/null +++ b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeMonitoringConfig.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataBoxEdgeMonitoringConfig')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataBoxEdgeMonitoringConfig.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-AzDataBoxEdgeMonitoringConfig' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeOrder.Tests.ps1 b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeOrder.Tests.ps1 new file mode 100644 index 000000000000..c6b3c91a40fb --- /dev/null +++ b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeOrder.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataBoxEdgeOrder')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataBoxEdgeOrder.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-AzDataBoxEdgeOrder' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeRole.Tests.ps1 b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeRole.Tests.ps1 new file mode 100644 index 000000000000..eb61e4ecb10d --- /dev/null +++ b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeRole.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataBoxEdgeRole')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataBoxEdgeRole.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-AzDataBoxEdgeRole' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeShare.Tests.ps1 b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeShare.Tests.ps1 new file mode 100644 index 000000000000..e89b82c7c370 --- /dev/null +++ b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeShare.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataBoxEdgeShare')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataBoxEdgeShare.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-AzDataBoxEdgeShare' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeStorageAccount.Tests.ps1 b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeStorageAccount.Tests.ps1 new file mode 100644 index 000000000000..e090bdcc32ba --- /dev/null +++ b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeStorageAccount.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataBoxEdgeStorageAccount')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataBoxEdgeStorageAccount.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-AzDataBoxEdgeStorageAccount' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeStorageAccountCredentials.Tests.ps1 b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeStorageAccountCredentials.Tests.ps1 new file mode 100644 index 000000000000..25f7a94a5b1e --- /dev/null +++ b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeStorageAccountCredentials.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataBoxEdgeStorageAccountCredentials')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataBoxEdgeStorageAccountCredentials.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-AzDataBoxEdgeStorageAccountCredentials' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeTrigger.Tests.ps1 b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeTrigger.Tests.ps1 new file mode 100644 index 000000000000..ac6b73a89777 --- /dev/null +++ b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeTrigger.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataBoxEdgeTrigger')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataBoxEdgeTrigger.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-AzDataBoxEdgeTrigger' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeUser.Tests.ps1 b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeUser.Tests.ps1 new file mode 100644 index 000000000000..0361de4af541 --- /dev/null +++ b/swaggerci/databoxedge/test/Remove-AzDataBoxEdgeUser.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzDataBoxEdgeUser')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzDataBoxEdgeUser.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-AzDataBoxEdgeUser' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Start-AzDataBoxEdgeSupportPackage.Tests.ps1 b/swaggerci/databoxedge/test/Start-AzDataBoxEdgeSupportPackage.Tests.ps1 new file mode 100644 index 000000000000..8e555b2dd2e2 --- /dev/null +++ b/swaggerci/databoxedge/test/Start-AzDataBoxEdgeSupportPackage.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Start-AzDataBoxEdgeSupportPackage')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Start-AzDataBoxEdgeSupportPackage.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 'Start-AzDataBoxEdgeSupportPackage' { + It 'TriggerExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Trigger' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'TriggerViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'TriggerViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility.Tests.ps1 b/swaggerci/databoxedge/test/Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility.Tests.ps1 new file mode 100644 index 000000000000..ce093db2e34b --- /dev/null +++ b/swaggerci/databoxedge/test/Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility.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 'Test-AzDataBoxEdgeDeviceCapacityCheckResourceCreationFeasibility' { + It 'CheckExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Check' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CheckViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CheckViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Update-AzDataBoxEdgeContainer.Tests.ps1 b/swaggerci/databoxedge/test/Update-AzDataBoxEdgeContainer.Tests.ps1 new file mode 100644 index 000000000000..50115d33614c --- /dev/null +++ b/swaggerci/databoxedge/test/Update-AzDataBoxEdgeContainer.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzDataBoxEdgeContainer')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzDataBoxEdgeContainer.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-AzDataBoxEdgeContainer' { + It 'Refresh' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RefreshViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Update-AzDataBoxEdgeDevice.Tests.ps1 b/swaggerci/databoxedge/test/Update-AzDataBoxEdgeDevice.Tests.ps1 new file mode 100644 index 000000000000..10e6d9010a34 --- /dev/null +++ b/swaggerci/databoxedge/test/Update-AzDataBoxEdgeDevice.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzDataBoxEdgeDevice')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzDataBoxEdgeDevice.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-AzDataBoxEdgeDevice' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Update-AzDataBoxEdgeDeviceExtendedInformation.Tests.ps1 b/swaggerci/databoxedge/test/Update-AzDataBoxEdgeDeviceExtendedInformation.Tests.ps1 new file mode 100644 index 000000000000..5b206f431c4c --- /dev/null +++ b/swaggerci/databoxedge/test/Update-AzDataBoxEdgeDeviceExtendedInformation.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzDataBoxEdgeDeviceExtendedInformation')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzDataBoxEdgeDeviceExtendedInformation.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-AzDataBoxEdgeDeviceExtendedInformation' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Update-AzDataBoxEdgeDeviceSecuritySetting.Tests.ps1 b/swaggerci/databoxedge/test/Update-AzDataBoxEdgeDeviceSecuritySetting.Tests.ps1 new file mode 100644 index 000000000000..0b6002fd01db --- /dev/null +++ b/swaggerci/databoxedge/test/Update-AzDataBoxEdgeDeviceSecuritySetting.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzDataBoxEdgeDeviceSecuritySetting')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzDataBoxEdgeDeviceSecuritySetting.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-AzDataBoxEdgeDeviceSecuritySetting' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/Update-AzDataBoxEdgeShare.Tests.ps1 b/swaggerci/databoxedge/test/Update-AzDataBoxEdgeShare.Tests.ps1 new file mode 100644 index 000000000000..cfa4adc36008 --- /dev/null +++ b/swaggerci/databoxedge/test/Update-AzDataBoxEdgeShare.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzDataBoxEdgeShare')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzDataBoxEdgeShare.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-AzDataBoxEdgeShare' { + It 'Refresh' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RefreshViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/databoxedge/test/loadEnv.ps1 b/swaggerci/databoxedge/test/loadEnv.ps1 new file mode 100644 index 000000000000..0ea394729062 --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/test/utils.ps1 b/swaggerci/databoxedge/test/utils.ps1 new file mode 100644 index 000000000000..1990edd45299 --- /dev/null +++ b/swaggerci/databoxedge/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/databoxedge/utils/Unprotect-SecureString.ps1 b/swaggerci/databoxedge/utils/Unprotect-SecureString.ps1 new file mode 100644 index 000000000000..cb05b51a6220 --- /dev/null +++ b/swaggerci/databoxedge/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